|
|
|
@ -82,17 +82,15 @@ class Order extends Backend |
|
|
|
|
$user_count = $single['user_count'] ?? 0; |
|
|
|
|
$dikou_price = $single['dikou_price'] ?? 0; |
|
|
|
|
|
|
|
|
|
// $info = Db::name('order')->alias('order') |
|
|
|
|
// ->field("count(order.id) as order_count,createtime,buyer_id") |
|
|
|
|
// // ->where("order_count",1) |
|
|
|
|
// //->whereTime('createtime', 'today') |
|
|
|
|
// ->group("buyer_id") |
|
|
|
|
// ->order('createtime desc') |
|
|
|
|
// ->select(); |
|
|
|
|
// var_dump($info); |
|
|
|
|
$users = Db::name('order')->field("buyer_id")->where('createtime', ">", strtotime(date("Y-m-d")))->group("buyer_id")->select(); |
|
|
|
|
// var_dump($users); |
|
|
|
|
// exit(); |
|
|
|
|
$new_user_count = $single['new_user_count'] ?? 0; |
|
|
|
|
$userIds = array_column($users, "buyer_id"); |
|
|
|
|
$beforeUsers = Db::name('order')->whereIn('buyer_id', $userIds)->field("buyer_id")->where('createtime', "<", strtotime(date("Y-m-d")))->group("buyer_id")->select(); |
|
|
|
|
|
|
|
|
|
$new_user_count = count($users) - count($beforeUsers); |
|
|
|
|
// var_dump($userIds); |
|
|
|
|
// exit(); |
|
|
|
|
$result = array( |
|
|
|
|
"total" => $list->total(), |
|
|
|
|
"rows" => $list->items(), |
|
|
|
|