维护用户销售统计——订单
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
* @Author: kangkang
|
||||
* @Date: 2020-10-13 19:52:37
|
||||
* @LastEditors: Please set LastEditors
|
||||
* @LastEditTime: 2020-11-24 15:55:55
|
||||
* @LastEditTime: 2020-11-25 09:51:47
|
||||
*/
|
||||
|
||||
namespace app\manager\controller;
|
||||
@@ -296,8 +296,48 @@ class UserFollow extends Controller
|
||||
}
|
||||
$id = $_GET['id'];
|
||||
$index = $_GET['index'];
|
||||
$user_score_model = new UserScore;
|
||||
\result($user_score_model->getUserCost($id, $index));
|
||||
$where = '';
|
||||
$list = [];
|
||||
|
||||
$product_order_model = new ProductOrder;
|
||||
$product_order_enum = new ProductOrderEnum;
|
||||
|
||||
if (isset($_GET['search'])) {
|
||||
$search = $_GET['search'];
|
||||
$flag = date("d", time()) == date("t", time());
|
||||
$date1 = date("Y-m-01", strtotime("-1 month"));
|
||||
$date2 = $flag ? date("Y-m-t H:i:s", strtotime("-1 month")) : date("Y-m-d H:i:s", strtotime("-1 month"));
|
||||
$date3 = date("Y-m-01", time());
|
||||
$date4 = date("Y-m-d H:i:s", time());
|
||||
if (!empty($search['last_month']['s_time'])) {
|
||||
$date1 = date('Y-m-d', strtotime($search['last_month']['s_time']));
|
||||
$date2 = date('Y-m-d H:i:s', strtotime($search['last_month']['e_time']));
|
||||
} elseif (!empty($search['new_month']['s_time'])) {
|
||||
$date3 = date('Y-m-d', strtotime($search['new_month']['s_time']));
|
||||
$date4 = date('Y-m-d H:i:s', strtotime($search['new_month']['e_time']));
|
||||
}
|
||||
}
|
||||
|
||||
switch ($index) {
|
||||
case 2:
|
||||
//上月
|
||||
$where .= " UpdateTime>='" . $date1 . "' and UpdateTime<='" . $date2 . "' ";
|
||||
break;
|
||||
case 3:
|
||||
//本月
|
||||
$where .= " UpdateTime>='" . $date3 . "' and UpdateTime<='" . $date4 . "' ";
|
||||
break;
|
||||
}
|
||||
|
||||
$data = $product_order_model->getUserCost($id, $index, $where);
|
||||
|
||||
foreach ($data as $info) {
|
||||
$info['OrderType'] = $product_order_enum::$OrderType[$info['OrderType']];
|
||||
$info['PayType'] = $product_order_enum::$ScoreName[$info['PayType']];
|
||||
$list[] = $info;
|
||||
}
|
||||
|
||||
\result($list);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user