request->get(); $type = isset($get['type']) ? $get['type'] : 0; $name = isset($get['name']) ? $get['name'] : ''; $where = ['ownShopId' => $this->shopId]; switch ($type) { case 1: //已开店 $where['isOpen'] = 1; break; default: } if (!empty($name)) { if (stringUtil::isMobile($name)) { $where['mobile'] = $name; } else { $where['name'] = ['like', $name]; } } $list = CustomService::getCustomList($where); util::success($list); } //客户详情 ssh 2021.1.8 public function actionDetail() { $get = Yii::$app->request->get(); $customId = $get['id'] ?? 0; $info = CustomService::getCustomInfo($customId); CustomClass::valid($info, $this->shopId); util::success($info); } //允许月结开关 ssh 2021.1.8 public function actionDebt() { $get = Yii::$app->request->get(); $debt = isset($get['debt']) ? $get['debt'] : 0; $customId = isset($get['customId']) ? $get['customId'] : 0; $custom = CustomClass::getById($customId); CustomClass::valid($custom, $this->shopId); CustomClass::debt($custom, $debt); util::complete(); } //欠款客户 ssh 2021.2.4 public function actionDebtList() { $get = Yii::$app->request->get(); $where = ['ownShopId' => $this->shopId, 'isDebt' => 1]; if (isset($get['name']) && !empty($get['name'])) { $where['name'] = ['like', $get['name']]; } $list = CustomService::getDebtList($where); //共X个客户,合计欠款XXX元 $shop = $this->shop; $list['customNum'] = $shop->mayGatheringNum ?? 0; $list['debtAmount'] = $shop->mayGathering ?? 0.00; util::success($list); } }