shish 6 жил өмнө
parent
commit
225e9a22e4

+ 37 - 0
app/saas/controllers/SetAuthController.php

@@ -0,0 +1,37 @@
+<?php
+
+namespace saas\controllers;
+
+use biz\saas\services\SetAuthService;
+use Yii;
+use common\components\util;
+
+
+class SetAuthController extends BaseController
+{
+	
+	//套餐列表 shish 2019.12.8
+	public function actionUpdate()
+	{
+		$post = Yii::$app->request->post();
+		$setId = isset($post['setId']) ? $post['setId'] : 0;
+		$endId = isset($post['endId']) ? $post['endId'] : 0;
+		$auth = isset($post['auth']) ? $post['auth'] : '*';
+		SetAuthService::updateByCondition(['setId' => $setId, 'endId' => $endId], ['auth' => $auth]);
+		util::ok('修改成功');
+	}
+	
+	public function actionDetail()
+	{
+		$get = Yii::$app->request->get();
+		$setId = isset($get['setId']) ? $get['setId'] : 0;
+		$endId = isset($get['endId']) ? $get['endId'] : 0;
+		$return = SetAuthService::getByCondition(['setId' => $setId, 'endId' => $endId]);
+		$authList = [];
+		if (isset($return['auth']) && !empty($return['auth'])) {
+			$authList = explode(',', $return['auth']);
+		}
+		util::success($authList);
+	}
+	
+}

+ 46 - 0
app/saas/controllers/SetMealController.php

@@ -0,0 +1,46 @@
+<?php
+
+namespace saas\controllers;
+
+use biz\saas\services\SetMealService;
+use Yii;
+use common\components\util;
+
+
+class SetMealController extends BaseController
+{
+	
+	//套餐列表 shish 2019.12.8
+	public function actionList()
+	{
+		$fest = SetMealService::getAllByCondition([], null, '*');
+		util::success($fest);
+	}
+	
+	//添加套餐 shish 2019.12.21
+	public function actionAdd()
+	{
+		$post = Yii::$app->request->post();
+		$return = SetMealService::add($post);
+		util::success($return);
+	}
+	
+	//修改套餐 shish 2019.12.21
+	public function actionUpdate()
+	{
+		$post = Yii::$app->request->post();
+		$id = $post['id'];
+		unset($post['id']);
+		SetMealService::updateById($id, $post);
+		util::ok();
+	}
+	
+	//套餐详情 shish 2019.12.21
+	public function actionDetail()
+	{
+		$id = Yii::$app->request->get('id');
+		$fest = SetMealService::getById($id);
+		util::success($fest);
+	}
+	
+}

+ 2 - 0
sql.txt

@@ -32,6 +32,8 @@ ALTER TABLE `xhMerchantAsset` ADD onGoods INT NOT NULL DEFAULT 0 COMMENT '上架
 ALTER TABLE `xhMerchantAsset` ADD offGoods INT NOT NULL DEFAULT 0 COMMENT '下架商品数' AFTER `totalGoods`;
 ALTER TABLE `xhFest` CHANGE `date` `month` TINYINT NOT NULL DEFAULT 1 COMMENT '月份';
 ALTER TABLE `xhFest` ADD `day` TINYINT NOT NULL DEFAULT 1 COMMENT '日期' AFTER `month`;
+ALTER TABLE `xhSetMeal` ADD num INT NOT NULL DEFAULT 0 COMMENT '花店数量' AFTER `price`;
+ALTER TABLE `xhSetMeal` DROP COLUMN `manageStyle`;
 
 2019.12.19 15:22 小程序相关
 ALTER TABLE `xhMerchantExtend` ADD miniVersion INT NOT NULL DEFAULT 0 COMMENT '小程序当前版本' AFTER `miniRefreshToken`;