浏览代码

申请审核

shish 6 年之前
父节点
当前提交
5c62657e82
共有 3 个文件被更改,包括 33 次插入3 次删除
  1. 22 2
      app/saas/controllers/ApplyController.php
  2. 7 1
      biz/saas/services/ApplyService.php
  3. 4 0
      sql.txt

+ 22 - 2
app/saas/controllers/ApplyController.php

@@ -10,7 +10,7 @@ use yii\web\Controller;
 
 class ApplyController extends BaseController
 {
-
+	
 	//申请列表
 	public function actionList()
 	{
@@ -18,5 +18,25 @@ class ApplyController extends BaseController
 		$list = ApplyService::getApplyList($where);
 		util::success($list);
 	}
-
+	
+	//审核
+	public function actionCheck()
+	{
+		$id = Yii::$app->request->post('id');
+		$status = Yii::$app->request->post('status', 0);
+		$remark = Yii::$app->request->post('remark', '');
+		$apply = ApplyService::getById($id);
+		if (empty($apply)) {
+			util::fail('找不到申请记录');
+		}
+		if ($apply['status'] != 0) {
+			util::fail('已经审过了');
+		}
+		ApplyService::updateById($id, ['status' => $status, 'remark' => $remark]);
+		if ($status == 1) {
+			ApplyService::pass($id);
+		}
+		util::success('操作成功');
+	}
+	
 }

+ 7 - 1
biz/saas/services/ApplyService.php

@@ -42,5 +42,11 @@ class ApplyService extends BaseService
 		return $data;
 		
 	}
-	
+
+	//审核通过
+	public static function pass($id)
+	{
+
+	}
+
 }

+ 4 - 0
sql.txt

@@ -12,6 +12,10 @@ merchantId INT NOT NULL DEFAULT 0 COMMENT '商家id',
 `status` TINYINT NOT NULL DEFAULT 0 COMMENT '0待审核 1审核通过 2审核未通过',
 `addTime` INT NOT NULL DEFAULT 0 COMMENT '添加时间'
 )COMMENT='小程序升级记录';
+DROP TABLE IF EXISTS `xhApplyOrder`;
+RENAME TABLE `xhOpenRenewOrder` TO `xhRenewAccount`;
+ALTER TABLE `xhApply` ADD remark VARCHAR(500) NOT NULL DEFAULT '' COMMENT '审核时添加的备注' AFTER `fullAddress`;
+ALTER TABLE `xhApply` MODIFY `status` TINYINT NOT NULL DEFAULT 0 COMMENT '0审核中 1审核通过、试用中 3审核未通过 4已付费 5试用到期失效';
 
 2019.12.19 20:14 商家相关再更新
 ALTER TABLE `xhMerchantAsset` MODIFY `totalOrder` INT NOT NULL DEFAULT 0 COMMENT '订单总数,包括所有的';