Browse Source

获取商家资产方式变更

shish 6 years ago
parent
commit
e552da9c5d

+ 3 - 2
app/business/controllers/AgentAssetController.php

@@ -3,6 +3,7 @@
 namespace business\controllers;
 
 use biz\agent\services\AgentAssetService;
+use biz\merchant\services\MerchantAssetService;
 use Yii;
 use common\components\util;
 
@@ -13,9 +14,9 @@ class AgentAssetController extends BaseController
 	public function actionDetail()
 	{
 		$detail = AgentAssetService::getDetail($this->merchantId);
-		$asset = $this->merchantAsset;
+		$asset = MerchantAssetService::getByMerchantId($this->merchantId);
 		$detail['balance'] = isset($asset['balance']) ? $asset['balance'] : 0;
 		util::success($detail);
 	}
-
+	
 }

+ 1 - 4
app/business/controllers/BaseController.php

@@ -3,7 +3,6 @@
 namespace business\controllers;
 
 use biz\merchant\services\AdminService;
-use biz\merchant\services\MerchantAssetService;
 use biz\merchant\services\MerchantExtendService;
 use biz\merchant\services\MerchantService;
 use common\components\httpUtil;
@@ -14,7 +13,7 @@ use common\components\util;
 class BaseController extends PublicController
 {
 	public $admin, $adminId, $adminAvatar, $account;
-	public $merchantId = 0, $merchantName, $merchant, $merchantExtend, $merchantAsset, $merchantLogo, $signPackage;
+	public $merchantId = 0, $merchantName, $merchant, $merchantExtend, $merchantLogo, $signPackage;
 	public $openMerchant, $openMerchantId;
 	public $appId;
 	public $isWx = false;
@@ -58,13 +57,11 @@ class BaseController extends PublicController
 		}
 		$merchant = MerchantService::getMerchantById($merchantId);
 		$merchantExtend = MerchantExtendService::getByMerchantId($merchantId);
-		$merchantAsset = MerchantAssetService::getByMerchantId($merchantId);
 		$this->admin = $admin;
 		$this->adminId = $adminId;
 		$this->merchantId = $merchantId;
 		$this->merchant = $merchant;
 		$this->merchantExtend = $merchantExtend;
-		$this->merchantAsset = $merchantAsset;
 		return parent::beforeAction($action);
 	}
 	

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

@@ -2,6 +2,7 @@
 
 namespace business\controllers;
 
+use biz\merchant\services\MerchantAssetService;
 use biz\stat\services\StatIncomeService;
 use biz\stat\services\StatOrderService;
 use biz\stat\services\StatUserService;
@@ -15,7 +16,7 @@ class ConsoleController extends BaseController
 	//概况 shish 2019.12.19
 	public function actionProfile()
 	{
-		$asset = $this->merchantAsset;
+		$asset = MerchantAssetService::getByMerchantId($this->merchantId);
 		$notice = [
 			['title' => '您还没有绑定公众号', 'action' => '立即绑定', 'url' => 'http://www.test.com'],
 		];

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

@@ -9,6 +9,7 @@
 namespace business\controllers;
 
 use biz\goods\services\GoodsSettingService;
+use biz\merchant\services\MerchantAssetService;
 use biz\saas\services\FestRiseService;
 use Yii;
 use common\components\util;
@@ -33,7 +34,7 @@ class GoodsController extends BaseController
 		$where['merchantId'] = $this->merchantId;
 		$where['delStatus'] = 0;
 		$data = GoodsService::getGoodsList($where);
-		$asset = $this->merchantAsset;
+		$asset = MerchantAssetService::getByMerchantId($this->merchantId);
 		$data['MerchantAsset'] = $asset;
 		util::success($data);
 	}

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

@@ -2,6 +2,7 @@
 
 namespace business\controllers;
 
+use biz\merchant\services\MerchantAssetService;
 use biz\merchant\services\MerchantExtendService;
 use biz\merchant\services\MerchantService;
 use biz\merchant\services\ShopService;
@@ -34,7 +35,7 @@ class OrderController extends BaseController
 			}
 		}
 		$list = OrderService::getOrderList($where);
-		$list['asset'] = $this->merchantAsset;
+		$list['asset'] = MerchantAssetService::getByMerchantId($this->merchantId);
 		util::success($list);
 	}
 	

+ 4 - 2
app/business/controllers/UserController.php

@@ -3,6 +3,7 @@
 namespace business\controllers;
 
 use biz\admin\services\AdminService;
+use biz\merchant\services\MerchantAssetService;
 use biz\merchant\services\MerchantExtendService;
 use biz\merchant\services\MerchantRemarkService;
 use biz\user\services\UserAssetService;
@@ -47,7 +48,7 @@ class UserController extends BaseController
 			}
 		}
 		$list = UserService::getUserList($where);
-		$list['asset'] = $this->merchantAsset;
+		$list['asset'] = MerchantAssetService::getByMerchantId($this->merchantId);
 		util::success($list);
 	}
 	
@@ -122,7 +123,8 @@ class UserController extends BaseController
 		$totalRecharge = $userAsset['totalRecharge'] + $rechargeAmount;
 		$upData['balance'] = $totalBalance;
 		$upData['totalRecharge'] = $totalRecharge;
-		$return = xhRechargeService::recharge($rechargeAmount, $user, $this->adminId, $this->merchant, $this->merchantExtend, $this->merchantAsset);
+		$merchantAsset = MerchantAssetService::getByMerchantId($this->merchantId);
+		$return = xhRechargeService::recharge($rechargeAmount, $user, $this->adminId, $this->merchant, $this->merchantExtend, $merchantAsset);
 		if ($return['code'] == 'A0001') {
 			util::ok();
 		}