我想从一个客户那里选择过去30天的所有订单,所以我需要customer_id ="$ customer_id"并计算每个客户每天订单的数量.
我需要最终得到像这样的数组
Array (
[1] => Array (
[orders] => 41
[date] => 2011-06-13 17:43:50
)
[2] => Array (
[orders] => 11
[date] => 2011-07-13 17:43:50
)
[4] => Array (
[orders] => 2
[date] => 2011-12-13 17:43:50
)
and so on... for 30 days, if some day I dont have any orders, I dont need array or [orders] = 0 ...
}
Run Code Online (Sandbox Code Playgroud)
我有一个名为"orders"的表,其中包含id,customer_id和date字段.
我发现这个问题SQL查询计算每日订单总数?但它没有帮助我,或者我不太了解它,顺便说一下我是初学者.谢谢!
ps我设法做的是选择过去30天的所有订单.
$this->db->query("SELECT * FROM …Run Code Online (Sandbox Code Playgroud) 当我获得新的 current_lang 时,我想在状态更改时重新加载 reCaptcha 小部件。
我使用了componentDidUpdate
componentDidUpdate() {
if (this.recaptchaInstance) {
this.recaptchaInstance.reset();
}
}
Run Code Online (Sandbox Code Playgroud)
看起来它重新渲染了组件,但语言保持不变?
这是我的组件
<Recaptcha
ref={e => (this.recaptchaInstance = e)}
sitekey="using_it_just_didnt_copy_it_here"
size="normal"
render="explicit"
hl={language.current_lang}
onloadCallback={this.onloadRecaptcha}
/>
Run Code Online (Sandbox Code Playgroud)
有人可以指出我正确的方向吗?谢谢!