|
|
@@ -118,10 +118,19 @@ class CustomController extends BaseController
|
|
|
$type = isset($get['type']) ? $get['type'] : 0;
|
|
|
$name = isset($get['name']) ? $get['name'] : '';
|
|
|
$where = ['ownShopId' => $this->shopId];
|
|
|
- //欠款客户
|
|
|
- if (!empty($type) && $type == 1) {
|
|
|
+
|
|
|
+ if ($type == 1) {
|
|
|
+ //欠款客户
|
|
|
$where['isDebt'] = 1;
|
|
|
+ $sort = 'debtAmount DESC';
|
|
|
+ } else if ($type == 2) {
|
|
|
+ //消费排行
|
|
|
+ $sort = 'buyAmount DESC';
|
|
|
+ } else {
|
|
|
+ //其它
|
|
|
+ $sort = 'addTime DESC';
|
|
|
}
|
|
|
+
|
|
|
if (!empty($name)) {
|
|
|
if (stringUtil::isLetter($name)) {
|
|
|
$where['py'] = ['like', $name];
|
|
|
@@ -129,11 +138,9 @@ class CustomController extends BaseController
|
|
|
$where['name'] = ['like', $name];
|
|
|
}
|
|
|
}
|
|
|
- if ($type == 2) {
|
|
|
- $list = CustomService::getCustomOrderList($where, 'buyAmount DESC');
|
|
|
- } else {
|
|
|
- $list = CustomService::getCustomList($where);
|
|
|
- }
|
|
|
+
|
|
|
+ $list = CustomService::getCustomSortList($where, $sort);
|
|
|
+
|
|
|
$shop = $this->shop;
|
|
|
$list['totalUser'] = $shop->totalUser ?? 0;
|
|
|
$list['mayGatheringNum'] = $shop->mayGatheringNum ?? 0;
|