소스 검색

增加用途

shish 6 년 전
부모
커밋
2802c3cb84

+ 1 - 2
app/business/controllers/CategoryController.php

@@ -18,8 +18,7 @@ class CategoryController extends BaseController
 	//分类列表
 	public function actionList()
 	{
-		$merchantId = Yii::$app->params['merchantId'];
-		$list = CategoryService::getCategoryList($merchantId);
+		$list = CategoryService::getCategoryList($this->merchantId);
 		util::success($list);
 	}
 	

+ 17 - 0
app/business/controllers/UsageController.php

@@ -0,0 +1,17 @@
+<?php
+namespace business\controllers;
+use biz\goods\services\UsageService;
+use common\components\util;
+use Yii;
+
+class UsageController extends BaseController
+{
+
+	//用途列表
+	public function actionList()
+	{
+		$list = UsageService::getUsageList();
+		util::success($list);
+	}
+
+}

+ 15 - 0
biz/goods/classes/UsageClass.php

@@ -0,0 +1,15 @@
+<?php
+
+namespace biz\goods\classes;
+
+use common\components\business;
+use common\components\util;
+use Yii;
+use biz\base\classes\BaseClass;
+
+class UsageClass extends BaseClass
+{
+	
+	public static $baseFile = '\biz\goods\models\Usage';
+	
+}

+ 13 - 0
biz/goods/models/Usage.php

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

+ 22 - 0
biz/goods/services/UsageService.php

@@ -0,0 +1,22 @@
+<?php
+
+namespace biz\goods\services;
+
+use biz\base\services\BaseService;
+use biz\goods\classes\CategoryClass;
+use biz\goods\classes\UsageClass;
+use common\components\util;
+use Yii;
+use linslin\yii2\curl;
+
+class UsageService extends BaseService
+{
+	
+	public static $baseFile = '\biz\goods\classes\UsageClass';
+
+	public static function getUsageList()
+	{
+		return UsageClass::getAllByCondition([], 'inTurn DESC', '*');
+	}
+
+}

+ 1 - 1
biz/merchant/services/ShopService.php

@@ -25,7 +25,7 @@ class ShopService extends BaseService
 		if ($phpStatDistance > $jsStatDistance) {
 			util::fail('前端计算距离有误');
 		}
-		$merchantId = Yii::$app->params['merchantId'];
+		$merchantId = $shopInfo['merchantId'];
 		$ext = MerchantExtendService::getByMerchantId($merchantId);
 		$freight = MerchantExtendService::getFreight($ext);
 		$firstDistance = $freight[0];

+ 0 - 1
common/services/xhPayToolService.php

@@ -98,7 +98,6 @@ class xhPayToolService
 			$userId = $order['userId'];
 			$totalFee = $order['actPrice'];
 			$merchantId = $order['merchantId'];
-			Yii::$app->params['merchantId'] = $merchantId;
 			$alipayId = isset($alipayParams['alipayId']) ? $alipayParams['alipayId'] : '';
 			$alipayAccount = isset($alipayParams['alipayAccount']) ? $alipayParams['alipayAccount'] : '';
 			$addPoint = floor($totalFee);

+ 1 - 0
sql.txt

@@ -5,6 +5,7 @@ UPDATE `xhUserGrowth` SET `relateId`=0;!!!!!!这条要使用php来
 ALTER TABLE `xhUserGrowth` MODIFY `relateId` int NOT NULL DEFAULT 0 COMMENT '关联id';
 UPDATE `xhUserCapital` SET `relateId`=0;!!!!!!这条要使用php来转换
 ALTER TABLE `xhUserCapital` MODIFY `relateId` int NOT NULL DEFAULT 0 COMMENT '关联id';
+ALTER TABLE xhUsage ADD `inTurn` INT NOT NULL DEFAULT 0 COMMENT '排序' AFTER `usageName`;
 
 2019.12.17 shish 用途相关的统计
 drop table if exists `xhStatIncomeUsage`;