diff --git a/crmeb/app/dao/activity/coupon/StoreCouponUserDao.php b/crmeb/app/dao/activity/coupon/StoreCouponUserDao.php index d1d291a5d..876995157 100644 --- a/crmeb/app/dao/activity/coupon/StoreCouponUserDao.php +++ b/crmeb/app/dao/activity/coupon/StoreCouponUserDao.php @@ -176,7 +176,7 @@ public function memberCouponUserGroupBymonth(array $where) ->whereMonth('add_time') ->whereIn('cid', $where['couponIds']) ->field('count(id) as num,FROM_UNIXTIME(add_time, \'%Y-%m\') as time') - ->group("FROM_UNIXTIME(add_time, '%Y-%m')") + ->group("time") ->select()->toArray(); } diff --git a/crmeb/app/dao/order/OtherOrderDao.php b/crmeb/app/dao/order/OtherOrderDao.php index 696769b4c..de72e6a38 100644 --- a/crmeb/app/dao/order/OtherOrderDao.php +++ b/crmeb/app/dao/order/OtherOrderDao.php @@ -107,7 +107,7 @@ public function getGroupField(array $where, string $field, string $group) $query->field("sum($field) as number,FROM_UNIXTIME($group, '$timeUinx') as time"); $query->group("FROM_UNIXTIME($group, '$timeUinx')"); }) - ->order('add_time ASC')->select()->toArray(); + ->order('time ASC')->select()->toArray(); } /**根据条件获取单条信息 diff --git a/crmeb/app/dao/order/StoreOrderDao.php b/crmeb/app/dao/order/StoreOrderDao.php index 85ab6c110..029280101 100644 --- a/crmeb/app/dao/order/StoreOrderDao.php +++ b/crmeb/app/dao/order/StoreOrderDao.php @@ -352,9 +352,9 @@ public function orderAddTimeList($datebefor, $dateafter, $timeType = "week") break; } $query->field("FROM_UNIXTIME(add_time,'$timeUnix') as day,count(*) as count,sum(pay_price) as price"); - $query->group("FROM_UNIXTIME(add_time, '$timeUnix')"); + $query->group("day"); }) - ->order('add_time asc') + ->order('day asc') ->select()->toArray(); } @@ -397,9 +397,9 @@ public function nowOrderList($now_datebefor, $now_dateafter, $timeType = "week") break; } $query->field("FROM_UNIXTIME(add_time,'$timeUnix') as day,count(*) as count,sum(pay_price) as price"); - $query->group("FROM_UNIXTIME(add_time, '$timeUnix')"); + $query->group("day"); }) - ->order('add_time asc') + ->order('day asc') ->select()->toArray(); } @@ -712,7 +712,7 @@ public function getDayGroupMoney(array $where, string $sumField, string $group) $timeUinx = "%Y-%m"; } $query->field("sum($sumField) as number,FROM_UNIXTIME($group, '$timeUinx') as time"); - $query->group("FROM_UNIXTIME($group, '$timeUinx')"); + $query->group("time"); }) ->order('pay_time ASC,id DESC')->select()->toArray(); } @@ -740,7 +740,7 @@ public function getOrderGroupCount(array $where, string $sumField = "*") $timeUinx = "%Y-%m"; } $query->field("count($sumField) as number,FROM_UNIXTIME(pay_time, '$timeUinx') as time"); - $query->group("FROM_UNIXTIME(pay_time, '$timeUinx')"); + $query->group("time"); }) ->order('pay_time ASC,id DESC')->select()->toArray(); } @@ -783,7 +783,7 @@ public function getPayOrderGroupPeople($where) $timeUinx = "%H"; } $query->field("count(distinct uid) as number,FROM_UNIXTIME(pay_time, '$timeUinx') as time"); - $query->group("FROM_UNIXTIME(pay_time, '$timeUinx')"); + $query->group("time"); }) ->order('pay_time ASC,id DESC')->select()->toArray(); } diff --git a/crmeb/app/dao/order/StoreOrderRefundDao.php b/crmeb/app/dao/order/StoreOrderRefundDao.php index b930de69c..c0f7a1860 100644 --- a/crmeb/app/dao/order/StoreOrderRefundDao.php +++ b/crmeb/app/dao/order/StoreOrderRefundDao.php @@ -166,7 +166,7 @@ public function getDayGroupMoney(array $where, string $sumField, string $group) $timeUinx = "%Y-%m"; } $query->field("sum($sumField) as number,FROM_UNIXTIME($group, '$timeUinx') as time"); - $query->group("FROM_UNIXTIME($group, '$timeUinx')"); + $query->group("time"); }) ->order('add_time ASC')->select()->toArray(); } diff --git a/crmeb/app/dao/system/statistics/CapitalFlowDao.php b/crmeb/app/dao/system/statistics/CapitalFlowDao.php index 0d6de0cd4..f49f5f929 100644 --- a/crmeb/app/dao/system/statistics/CapitalFlowDao.php +++ b/crmeb/app/dao/system/statistics/CapitalFlowDao.php @@ -69,7 +69,7 @@ public function getRecordList($where, int $page = 0, int $limit = 0) $model = $this->search($where, false) ->when(isset($where['type']) && $where['type'] !== '', function ($query) use ($where, $timeUnix) { $query->field("FROM_UNIXTIME(add_time,'$timeUnix') as day,sum(if(price >= 0,price,0)) as income_price,sum(if(price < 0,price,0)) as exp_price,add_time"); - $query->group("FROM_UNIXTIME(add_time, '$timeUnix')"); + $query->group("day"); }); $count = $model->count(); $list = $model->when($page && $limit, function ($query) use ($page, $limit) { diff --git a/crmeb/app/dao/user/UserBillDao.php b/crmeb/app/dao/user/UserBillDao.php index 26bb4aabe..e885c6d2d 100644 --- a/crmeb/app/dao/user/UserBillDao.php +++ b/crmeb/app/dao/user/UserBillDao.php @@ -273,7 +273,7 @@ public function getGroupField(array $where, string $field, string $group) $timeUinx = "%Y-%m"; } $query->field("sum($field) as number,FROM_UNIXTIME($group, '$timeUinx') as time"); - $query->group("FROM_UNIXTIME($group, '$timeUinx')"); + $query->group("time"); }) ->order('add_time ASC')->select()->toArray(); } diff --git a/crmeb/app/dao/user/UserDao.php b/crmeb/app/dao/user/UserDao.php index 3c5a74a39..637870668 100644 --- a/crmeb/app/dao/user/UserDao.php +++ b/crmeb/app/dao/user/UserDao.php @@ -249,8 +249,8 @@ public function userList($starday, $yesterday) return $this->getModel() ->whereBetweenTime('add_time', $starday, $yesterday) ->field("FROM_UNIXTIME(add_time,'%m-%e') as day,count(*) as count") - ->group("FROM_UNIXTIME(add_time, '%Y%m%e')") - ->order('add_time asc')->select()->toArray(); + ->group("day") + ->order('day asc')->select()->toArray(); } /** diff --git a/crmeb/app/dao/user/UserExtractDao.php b/crmeb/app/dao/user/UserExtractDao.php index 2bb55cb40..041178ecc 100644 --- a/crmeb/app/dao/user/UserExtractDao.php +++ b/crmeb/app/dao/user/UserExtractDao.php @@ -112,7 +112,7 @@ public function getGroupField(array $where, string $field, string $group) $timeUinx = "%Y-%m"; } $query->field("sum($field) as number,FROM_UNIXTIME($group, '$timeUinx') as time"); - $query->group("FROM_UNIXTIME($group, '$timeUinx')"); + $query->group("time"); }) ->order('add_time ASC')->select()->toArray(); } diff --git a/crmeb/app/dao/user/UserMoneyDao.php b/crmeb/app/dao/user/UserMoneyDao.php index 6f4c747e7..fc9ea6541 100644 --- a/crmeb/app/dao/user/UserMoneyDao.php +++ b/crmeb/app/dao/user/UserMoneyDao.php @@ -108,7 +108,7 @@ public function getGroupField(array $where, string $field, string $group) $timeUinx = "%Y-%m"; } $query->field("sum($field) as number,FROM_UNIXTIME($group, '$timeUinx') as time"); - $query->group("FROM_UNIXTIME($group, '$timeUinx')"); + $query->group("time"); }) ->order('add_time ASC')->select()->toArray(); } diff --git a/crmeb/app/dao/user/UserRechargeDao.php b/crmeb/app/dao/user/UserRechargeDao.php index e7446da85..839046250 100644 --- a/crmeb/app/dao/user/UserRechargeDao.php +++ b/crmeb/app/dao/user/UserRechargeDao.php @@ -88,7 +88,7 @@ public function getGroupField(array $where, string $field, string $group) $timeUinx = "%Y-%m"; } $query->field("sum($field) as number,FROM_UNIXTIME($group, '$timeUinx') as time"); - $query->group("FROM_UNIXTIME($group, '$timeUinx')"); + $query->group("time"); }) ->order('add_time ASC')->select()->toArray();