|
@@ -14,6 +14,7 @@ use bizGhs\order\classes\OrderClass;
|
|
|
use bizHd\saas\classes\ApplyClass;
|
|
use bizHd\saas\classes\ApplyClass;
|
|
|
use bizHd\saas\services\ApplyService;
|
|
use bizHd\saas\services\ApplyService;
|
|
|
use bizHd\shop\classes\ShopClass;
|
|
use bizHd\shop\classes\ShopClass;
|
|
|
|
|
+
|
|
|
//use bizHd\stat\classes\StatVisitClass;
|
|
//use bizHd\stat\classes\StatVisitClass;
|
|
|
use bizGhs\stat\classes\StatVisitClass;
|
|
use bizGhs\stat\classes\StatVisitClass;
|
|
|
use common\components\dict;
|
|
use common\components\dict;
|
|
@@ -665,8 +666,8 @@ class CustomController extends BaseController
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
$get = Yii::$app->request->get();
|
|
$get = Yii::$app->request->get();
|
|
|
- $type = isset($get['type']) ? $get['type'] : 0;
|
|
|
|
|
- $name = isset($get['name']) ? $get['name'] : '';
|
|
|
|
|
|
|
+ $type = $get['type'] ?? 0;
|
|
|
|
|
+ $name = $get['name'] ?? '';
|
|
|
$export = $get['export'] ?? 0;
|
|
$export = $get['export'] ?? 0;
|
|
|
$mainId = $this->mainId;
|
|
$mainId = $this->mainId;
|
|
|
$isCashier = $get['isCashier'] ?? 0;
|
|
$isCashier = $get['isCashier'] ?? 0;
|
|
@@ -678,6 +679,7 @@ class CustomController extends BaseController
|
|
|
|
|
|
|
|
$where = ['ownMainId' => $this->mainId];
|
|
$where = ['ownMainId' => $this->mainId];
|
|
|
$sort = 'visitTime DESC';
|
|
$sort = 'visitTime DESC';
|
|
|
|
|
+ $where['delStatus'] = 0;
|
|
|
if ($type == 1) {
|
|
if ($type == 1) {
|
|
|
//消费排行
|
|
//消费排行
|
|
|
$sort = 'buyAmount DESC';
|
|
$sort = 'buyAmount DESC';
|
|
@@ -686,15 +688,25 @@ class CustomController extends BaseController
|
|
|
$where['isDebt'] = 1;
|
|
$where['isDebt'] = 1;
|
|
|
$sort = '(debtAmount-balance) DESC';
|
|
$sort = '(debtAmount-balance) DESC';
|
|
|
} else if ($type == 3) {
|
|
} else if ($type == 3) {
|
|
|
- $where['level'] = 0;
|
|
|
|
|
|
|
+ //大客户
|
|
|
|
|
+ $where['level'] = 2;
|
|
|
} else if ($type == 4) {
|
|
} else if ($type == 4) {
|
|
|
- //最近未下单
|
|
|
|
|
|
|
+ //零售客户
|
|
|
|
|
+ $where['level'] = 0;
|
|
|
|
|
+ } else if ($type == 5) {
|
|
|
|
|
+ //休眠客户
|
|
|
$recentDay = isset($get['recentDay']) && is_numeric($get['recentDay']) ? (int)$get['recentDay'] : 7;
|
|
$recentDay = isset($get['recentDay']) && is_numeric($get['recentDay']) ? (int)$get['recentDay'] : 7;
|
|
|
$totalSecond = bcmul(86400, $recentDay);
|
|
$totalSecond = bcmul(86400, $recentDay);
|
|
|
$currentSecond = bcsub(time(), $totalSecond);
|
|
$currentSecond = bcsub(time(), $totalSecond);
|
|
|
$currentDate = date("Y-m-d H:i:s", $currentSecond);
|
|
$currentDate = date("Y-m-d H:i:s", $currentSecond);
|
|
|
$where['recentExpend<'] = $currentDate;
|
|
$where['recentExpend<'] = $currentDate;
|
|
|
$sort = 'recentExpend desc';
|
|
$sort = 'recentExpend desc';
|
|
|
|
|
+ } else if ($type == 6) {
|
|
|
|
|
+ //黑名单
|
|
|
|
|
+ $where['black'] = 2;
|
|
|
|
|
+ } else if ($type == 7) {
|
|
|
|
|
+ //已删除
|
|
|
|
|
+ $where['delStatus'] = 1;
|
|
|
}
|
|
}
|
|
|
$name = trim($name);
|
|
$name = trim($name);
|
|
|
if (!empty($name)) {
|
|
if (!empty($name)) {
|
|
@@ -1047,7 +1059,7 @@ class CustomController extends BaseController
|
|
|
public function actionShowTotalBalance()
|
|
public function actionShowTotalBalance()
|
|
|
{
|
|
{
|
|
|
$lookMoney = \bizGhs\shop\classes\ShopAdminClass::lookMoneyPower($this->shopAdmin, $this->shop);
|
|
$lookMoney = \bizGhs\shop\classes\ShopAdminClass::lookMoneyPower($this->shopAdmin, $this->shop);
|
|
|
- if($lookMoney == 0){
|
|
|
|
|
|
|
+ if ($lookMoney == 0) {
|
|
|
util::fail('无法查看哦');
|
|
util::fail('无法查看哦');
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1060,4 +1072,23 @@ class CustomController extends BaseController
|
|
|
util::success($respond);
|
|
util::success($respond);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ public function actionChangeDelStatus()
|
|
|
|
|
+ {
|
|
|
|
|
+ $get = Yii::$app->request->get();
|
|
|
|
|
+ $customId = $get['id'] ?? 0;
|
|
|
|
|
+ $delStatus = $get['delStatus'] ?? 0;
|
|
|
|
|
+ $custom = CustomClass::getById($customId, true);
|
|
|
|
|
+ CustomClass::valid($custom, $this->shopId);
|
|
|
|
|
+ $ghsId = $custom->ghsId ?? 0;
|
|
|
|
|
+ $ghs = GhsClass::getById($ghsId, true);
|
|
|
|
|
+ if (empty($ghs)) {
|
|
|
|
|
+ util::fail('客户信息有缺失');
|
|
|
|
|
+ }
|
|
|
|
|
+ $custom->delStatus = $delStatus;
|
|
|
|
|
+ $custom->save();
|
|
|
|
|
+ $ghs->delStatus = $delStatus;
|
|
|
|
|
+ $ghs->save();
|
|
|
|
|
+ util::complete('删除成功');
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|