公主小凡博客,9887小游戏,ipz-014
获取今日订单总数和订单总金额
//fields区分出order_type不等于1的订单,订单金额money加运费order_freight合计 $fields = [ 'count(1) as order_num', 'sum(if(order_type != 1, money + order_freight, 0)) as order_price' ]; //where区分统计今日订单,已付款pay_status状态 $where = [ [ 'create_time', 'between', strtotime(date('y-m-d')).','.strtotime(date('y-m-d 23:59:59')), ], [ 'pay_status','=',1, ] ]; $static = $this->field($field)->where($where)->where('is_deleted', 0)->find(); return $static ? $static->toarray() : [];
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
php的instanceof和判断闭包Closure操作示例
php数组函数array_push()、array_pop()及array_shift()简单用法示例
yii2.0框架实现上传excel文件后导入到数据库的方法示例
php使用goto实现自动重启swoole、reactphp、workerman服务的代码
网友评论