Explorar el Código

审核更新版本

shish hace 6 años
padre
commit
e7477f2133

+ 32 - 0
app/saas/controllers/MiniUpgradeController.php

@@ -0,0 +1,32 @@
+<?php
+
+namespace saas\controllers;
+
+use biz\weixin\services\MiniUpgradeService;
+use common\components\util;
+use Yii;
+use yii\web\Controller;
+
+class MiniUpgradeController extends BaseController
+{
+
+	//审核记录
+	public function actionList()
+	{
+		$where = [];
+		$status = Yii::$app->request->get('status', -1);
+		if ($status != -1) {
+			$where['status'] = $status;
+		}
+		$list = MiniUpgradeService::getUpgradeList($where);
+		util::success($list);
+	}
+
+	//更新版本 shish 2019.12.20
+	public function actionUpdate()
+	{
+		$version = Yii::$app->request->get('version');
+		util::ok('提交成功');
+	}
+
+}

+ 13 - 0
biz/weixin/classes/MiniUpgradeClass.php

@@ -0,0 +1,13 @@
+<?php
+
+namespace biz\weixin\classes;
+
+use Yii;
+use biz\base\classes\BaseClass;
+
+class MiniUpgradeClass extends BaseClass
+{
+
+	public static $baseFile = '\biz\weixin\models\MiniUpgrade';
+
+}

+ 13 - 0
biz/weixin/models/MiniUpgrade.php

@@ -0,0 +1,13 @@
+<?php
+namespace biz\weixin\models;
+use biz\base\models\Base;
+
+class MiniUpgrade extends Base
+{
+
+	public static function tableName()
+	{
+		return 'xhMiniUpgrade';
+	}
+
+}

+ 36 - 0
biz/weixin/services/MiniUpgradeService.php

@@ -0,0 +1,36 @@
+<?php
+
+namespace biz\weixin\services;
+
+use biz\base\services\BaseService;
+use biz\merchant\services\MerchantService;
+use biz\weixin\classes\MiniUpgradeClass;
+use Yii;
+
+class MiniUpgradeService extends BaseService
+{
+	
+	public static $baseFile = '\biz\weixin\classes\MiniUpgradeClass';
+	
+	//获取升级申请的记录 shish 2019.12.20
+	public static function getUpgradeList($where)
+	{
+		$data = MiniUpgradeClass::getList('*', $where, 'addTime DESC');
+		$list = isset($data['list']) ? $data['list'] : [];
+		if (empty($list)) {
+			return $data;
+		}
+		$ids = array_column($list, 'merchantId');
+		$ids = array_filter(array_unique($ids));
+		
+		$merchant = MerchantService::getMerchantByIds($ids);
+		
+		foreach ($list as $key => $val) {
+			$merchantId = $val['merchantId'];
+			$list[$key]['miniName'] = isset($merchant[$merchantId]['merchantName']) ? $merchant[$merchantId]['merchantName'] : '';
+		}
+		$data['list'] = $list;
+		return $data;
+	}
+	
+}

+ 3 - 1
sql.txt

@@ -15,7 +15,9 @@ merchantId INT NOT NULL DEFAULT 0 COMMENT '商家id',
 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试用到期失效';
+ALTER TABLE `xhApply` MODIFY `status` TINYINT NOT NULL DEFAULT 0 COMMENT '0审核中 1审核通过、试用中 2审核未通过 3已付费 4试用到期失效';
+ALTER TABLE `xhMiniUpgrade` MODIFY `status` TINYINT NOT NULL DEFAULT 0 COMMENT '0待审核 1审核通过,待上线 2审核未通过 3已上线';
+ALTER TABLE `xhMiniUpgrade` ADD `onTime` INT NOT NULL DEFAULT 0 COMMENT '上线时间' AFTER `version`;
 
 2019.12.19 20:14 商家相关再更新
 ALTER TABLE `xhMerchantAsset` MODIFY `totalOrder` INT NOT NULL DEFAULT 0 COMMENT '订单总数,包括所有的';