shish 5 lat temu
rodzic
commit
c5797f8fb8

+ 2 - 6
app/ghs/controllers/ApplyController.php

@@ -49,18 +49,14 @@ class ApplyController extends BaseController
 		ApplyService::updateById($id, ['status' => $status, 'remark' => $remark]);
 		util::success('操作成功');
 	}
-	
-	//申请试用 shish 2020.1.11
+
+	//申请试用,花店添加新客户 shish 2021.1.8
 	public function actionRegister()
 	{
 		$get = Yii::$app->request->get();
 		$get['adminId'] = $this->adminId;
 		$get['long'] = isset($get['longitude']) ? $get['longitude'] : '';
 		$get['lat'] = isset($get['latitude']) ? $get['latitude'] : '';
-		$introMerchantId = isset($get['introMerchantId']) && !empty($get['introMerchantId']) ? $get['introMerchantId'] : 0;
-		if (empty($introMerchantId)) {
-			util::fail('只有邀请了才能注册哦~');
-		}
 		$mobile = isset($get['mobile']) && !empty($get['mobile']) && stringUtil::isMobile($get['mobile']) ? $get['mobile'] : 0;
 		if (empty($mobile)) {
 			util::fail('请填写正确手机号');

+ 10 - 0
app/ghs/controllers/CustomController.php

@@ -2,6 +2,7 @@
 
 namespace ghs\controllers;
 
+use biz\saas\classes\ApplyClass;
 use bizGhs\custom\classes\CustomClass;
 use bizGhs\custom\services\CustomService;
 use common\components\stringUtil;
@@ -44,6 +45,7 @@ class CustomController extends BaseController
         $shopId = isset($get['shopId']) ? $get['shopId'] : -1;
         $ghsId = $this->ghsId;
         $info = CustomService::getFullInfo($ghsId, $shopId);
+        CustomClass::valid($info, $this->ghsId);
         util::success($info);
     }
 
@@ -59,4 +61,12 @@ class CustomController extends BaseController
         util::complete();
     }
 
+    //添加新客户 shish 2021.1.8
+    public function actionAdd()
+    {
+        $get = Yii::$app->request->get();
+        ApplyClass::addApply($get, 1);
+        util::complete('已提交审核');
+    }
+
 }

+ 1 - 1
biz/saas/classes/ApplyClass.php

@@ -15,7 +15,7 @@ class ApplyClass extends BaseClass
     public static $baseFile = '\biz\saas\models\Apply';
 
     //添加申请 shish 2020.2.10
-    public static function addApply($data)
+    public static function addApply($data,$from=0)
     {
         $mobile = isset($data['mobile']) ? $data['mobile'] : 0;
         if (stringUtil::isMobile($mobile) == false) {

+ 3 - 1
sql.sql

@@ -208,4 +208,6 @@ ALTER TABLE `xhGhsCustom` ADD debt TINYINT NOT NULL DEFAULT 0 COMMENT '是否允
 ALTER TABLE `xhGhsCustom` ADD debtAmount DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '欠款金额' AFTER `debt`;
 ALTER TABLE `xhGhsCustom` ADD buyNum INT NOT NULL DEFAULT 0 COMMENT '消费次数' AFTER `debtAmount`;
 ALTER TABLE `xhGhsCustom` ADD buyAmount DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '消费总金额' AFTER `buyNum`;
-ALTER TABLE xhGhsShopAdmin CHANGE merchantId `ghsId` INT NOT NULL DEFAULT 0 COMMENT '供货商id merchantId';
+ALTER TABLE xhGhsShopAdmin CHANGE merchantId `ghsId` INT NOT NULL DEFAULT 0 COMMENT '供货商id merchantId';
+ALTER TABLE xhApply ADD updateTime INT NOT NULL DEFAULT 0 COMMENT '修改时间' AFTER `addTime`;
+ALTER TABLE xhApply ADD `from` TINYINT NOT NULL DEFAULT 0 COMMENT '来源 0花店自己申请 1供货商发起' AFTER `introMerchantId`;