Browse Source

命名空间

shish 6 năm trước cách đây
mục cha
commit
4ce53e056f

+ 4 - 4
.gitignore

@@ -7,16 +7,16 @@
 console/runtime/
 
 #ignore
-app/business/runtime/
+app/shop/runtime/
 app/api/runtime/
-app/client/runtime/
+app/mall/runtime/
 app/open/runtime/
 app/saas/runtime/
 app/www/runtime/
 
-app/business/web/assets/
+app/shop/web/assets/
 app/api/web/assets/
-app/client/web/assets/
+app/mall/web/assets/
 app/open/web/assets/
 app/saas/web/assets/
 app/www/web/assets/

+ 1 - 1
app/mall/config/main.php

@@ -11,7 +11,7 @@ return [
     'basePath' => dirname(__DIR__),
     'bootstrap' => ['log'],
     'defaultRoute' => 'main/index',//默认控制器
-    'controllerNamespace' => 'client\controllers',
+    'controllerNamespace' => 'mall\controllers',
     'components' => [
 	    'user' => [
 		    'identityClass' => 'common\models\xhUser',

+ 1 - 1
app/shop/config/main.php

@@ -11,7 +11,7 @@ return [
 	'basePath' => dirname(__DIR__),
 	'bootstrap' => ['log'],
 	'defaultRoute' => 'main/index',//默认控制器
-	'controllerNamespace' => 'business\controllers',
+	'controllerNamespace' => 'shop\controllers',
 	'modules' => [],
 	'components' => [
 		'user' => [

+ 63 - 0
app/shop/controllers/SetMealController.php

@@ -0,0 +1,63 @@
+<?php
+
+namespace www\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::complete();
+	}
+	
+	//套餐详情 shish 2019.12.21
+	public function actionDetail()
+	{
+		$id = Yii::$app->request->get('id');
+		$fest = SetMealService::getById($id);
+		util::success($fest);
+	}
+	
+	//花店老板查看套餐详情 shish 2020.1.11
+	public function actionGetDetail()
+	{
+		$id = Yii::$app->request->get('id', 1);
+		$detail = SetMealService::getSetById($id);
+		$detail['introduce'] = '适用于5人以下的花店,可以满足日常的经常、管理和营销需求。';
+		$function = [
+			['name' => '微信商城', 'has' => 1],
+			['name' => '节日自动涨价', 'has' => 1],
+			['name' => '小程序商城', 'has' => 1],
+			['name' => '人脸支付', 'has' => 0],
+		];
+		$free = rand(0, 1);
+		$data = ['detail' => $detail, 'function' => $function, 'free' => $free];
+		util::success($data);
+	}
+	
+}