lqmac 1 year ago
parent d22ea6071f
commit b3562824ee
  1. 18
      application/admin/controller/Order.php

@ -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();
$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();
$new_user_count = $single['new_user_count'] ?? 0;
$result = array(
"total" => $list->total(),
"rows" => $list->items(),

Loading…
Cancel
Save