|
|
@@ -13,85 +13,85 @@ use Yii;
|
|
|
|
|
|
class CustomController extends BaseController
|
|
|
{
|
|
|
-
|
|
|
- //客户列表 ssh 2021.7.8
|
|
|
- public function actionList()
|
|
|
- {
|
|
|
- $get = Yii::$app->request->get();
|
|
|
- $type = isset($get['type']) ? $get['type'] : 0;
|
|
|
- $name = isset($get['name']) ? $get['name'] : '';
|
|
|
- $where = ['ownSjId' => $this->sjId];
|
|
|
- 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->sjId);
|
|
|
- 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->sjId);
|
|
|
- CustomClass::debt($custom, $debt);
|
|
|
- util::complete();
|
|
|
- }
|
|
|
-
|
|
|
- //添加新客户 ssh 2021.1.8
|
|
|
- public function actionAdd()
|
|
|
- {
|
|
|
- $post = Yii::$app->request->post();
|
|
|
- $post['style'] = SjClass::STYLE_RETAIL;
|
|
|
- $post['from'] = ApplyClass::FROM_GHS;
|
|
|
- $post['introSjId'] = $this->sjId;
|
|
|
- $post['introStyle'] = SjClass::STYLE_SUPPLIER;
|
|
|
- $post['certType'] = ApplyClass::CERT_TYPE_MOBILE;
|
|
|
- $mobile = $post['mobile'] ?? '';
|
|
|
- $confirmMobile = $post['confirmMobile'];
|
|
|
- if (stringUtil::isMobile($mobile) == false) {
|
|
|
- util::fail(' 请填写正确的手机号');
|
|
|
- }
|
|
|
- if ($mobile != $confirmMobile) {
|
|
|
- util::fail('二次号码填写不一致');
|
|
|
- }
|
|
|
- ApplyService::replaceApply($post);
|
|
|
- util::complete('添加成功,等待审核');
|
|
|
- }
|
|
|
|
|
|
- //欠款客户 ssh 2021.2.4
|
|
|
- public function actionDebtList()
|
|
|
- {
|
|
|
- $get = Yii::$app->request->get();
|
|
|
- $where = ['sjId' => $this->sjId, 'isDebt' => 1];
|
|
|
- if (isset($get['name']) && !empty($get['name'])) {
|
|
|
- $where['name'] = ['like', $get['name']];
|
|
|
- }
|
|
|
- $list = CustomService::getDebtList($where);
|
|
|
- util::success($list);
|
|
|
- }
|
|
|
+ //客户列表 ssh 2021.7.8
|
|
|
+ public function actionList()
|
|
|
+ {
|
|
|
+ $get = Yii::$app->request->get();
|
|
|
+ $type = isset($get['type']) ? $get['type'] : 0;
|
|
|
+ $name = isset($get['name']) ? $get['name'] : '';
|
|
|
+ $where = ['ownSjId' => $this->sjId];
|
|
|
+ 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->sjId);
|
|
|
+ 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->sjId);
|
|
|
+ CustomClass::debt($custom, $debt);
|
|
|
+ util::complete();
|
|
|
+ }
|
|
|
+
|
|
|
+ //添加新客户 ssh 2021.1.8
|
|
|
+ public function actionAdd()
|
|
|
+ {
|
|
|
+ $post = Yii::$app->request->post();
|
|
|
+ $post['style'] = SjClass::STYLE_RETAIL;
|
|
|
+ $post['from'] = ApplyClass::FROM_GHS;
|
|
|
+ $post['introSjId'] = $this->sjId;
|
|
|
+ $post['introStyle'] = SjClass::STYLE_SUPPLIER;
|
|
|
+ $post['certType'] = ApplyClass::CERT_TYPE_MOBILE;
|
|
|
+ $mobile = $post['mobile'] ?? '';
|
|
|
+ $confirmMobile = $post['confirmMobile'];
|
|
|
+ if (stringUtil::isMobile($mobile) == false) {
|
|
|
+ util::fail(' 请填写正确的手机号');
|
|
|
+ }
|
|
|
+ if ($mobile != $confirmMobile) {
|
|
|
+ util::fail('二次号码填写不一致');
|
|
|
+ }
|
|
|
+ ApplyService::replaceApply($post);
|
|
|
+ util::complete('添加成功,等待审核');
|
|
|
+ }
|
|
|
+
|
|
|
+ //欠款客户 ssh 2021.2.4
|
|
|
+ public function actionDebtList()
|
|
|
+ {
|
|
|
+ $get = Yii::$app->request->get();
|
|
|
+ $where = ['ownSjId' => $this->sjId, 'isDebt' => 1];
|
|
|
+ if (isset($get['name']) && !empty($get['name'])) {
|
|
|
+ $where['name'] = ['like', $get['name']];
|
|
|
+ }
|
|
|
+ $list = CustomService::getDebtList($where);
|
|
|
+ util::success($list);
|
|
|
+ }
|
|
|
|
|
|
}
|