shish 6 years ago
parent
commit
601d79b371

+ 6 - 5
app/saas/controllers/TestController.php

@@ -71,17 +71,18 @@ class TestController extends PublicController
 		echo json_encode($resp);
 		
 	}
-	
+
 	public function actionRabbit()
 	{
 		$orderId = 214752;
 		$order = OrderService::getById($orderId);
 		$merchantId = $order['merchantId'];
+		$openMerchant = WxOpenService::getWxInfo();
 		$merchant = MerchantService::getMerchantById($merchantId);
-		$params = ['sourceType' => $order['sourceType'], 'miniAppId' => $merchant['miniAppId'], 'orderId' => $orderId];
-		$type = 'income';
 		$shopId = $merchant['defaultShopId'];
-		InformAdminService::addInform($merchantId, $shopId, $type, $params);
+		$params = ['sourceType' => $order['sourceType'], 'miniAppId' => $openMerchant['miniAppId'], 'orderId' => $orderId];
+		$type = 'income';
+		InformAdminService::addInform($shopId, $type, $params);
 	}
-	
+
 }

+ 1 - 1
biz/message/classes/InformAdminClass.php

@@ -112,7 +112,7 @@ class InformAdminClass extends BaseClass
 		$data['briefContent'] = "客户" . $userName . "付款" . $totalFee . '元';
 		//收入提醒
 		$openId = isset($admin['adminBaseInfo']['openId']) ? $admin['adminBaseInfo']['openId'] : '';
-		$miniOpenId = isset($admin['miniOpenId']) && !empty($admin['miniOpenId']) ? $admin['miniOpenId'] : '';
+		$miniOpenId = isset($admin['adminBaseInfo']['miniOpenId']) ? $admin['adminBaseInfo']['miniOpenId'] : '';
 		$shortTempId = 'OPENTM207422813';
 		$tempId = isset($TMList[$shortTempId]) ? $TMList[$shortTempId] : '';
 		$tMessage = [

+ 1 - 1
biz/message/services/InformAdminService.php

@@ -21,7 +21,7 @@ class InformAdminService extends BaseService
 	public static $baseFile = '\biz\message\classes\InformAdminClass';
 	
 	//通知管理员 shish 2020.1.1
-	public static function addInform($merchantId, $shopId, $type, $params)
+	public static function addInform($shopId, $type, $params)
 	{
 		$adminShopList = AdminShopService::getNoticeAdminList($shopId);
 		if (empty($adminShopList)) {

+ 4 - 4
common/services/xhMerchantAssetService.php

@@ -5,6 +5,7 @@ namespace common\services;
 use biz\message\services\InformAdminService;
 use biz\stat\services\StatIncomeCategoryService;
 use biz\stat\services\StatIncomeSourceService;
+use biz\wx\services\WxOpenService;
 use Yii;
 use common\components\configDict;
 use common\components\stringUtil;
@@ -64,8 +65,7 @@ class xhMerchantAssetService
 	public static function incomeChangeAsset($merchant, $merchantAsset, $shopId, $updateData, $order, $capitalType, $isRecharge = false)
 	{
 		$merchantId = $merchant['id'];
-		$openMerchant = xhWxOpenService::getMerchant();
-		$openMerchantId = $openMerchant['id'];
+		$openMerchant = WxOpenService::getWxInfo();
 		$orderId = $order['id'];
 		$date = date("Y-m-d H:i");
 		$totalFee = 0;
@@ -95,9 +95,9 @@ class xhMerchantAssetService
 				}
 				//sourceType 0商城 1门店 2微信朋友圈 3美团
 				//收入提醒 shish 2020.1.30
-				$params = ['sourceType' => $order['sourceType'], 'miniAppId' => $merchant['miniAppId'], 'orderId' => $orderId];
+				$params = ['sourceType' => $order['sourceType'], 'miniAppId' => $openMerchant['miniAppId'], 'orderId' => $orderId];
 				$type = 'income';
-				InformAdminService::addInform($merchantId, $shopId, $type, $params);
+				InformAdminService::addInform($shopId, $type, $params);
 				break;
 			default:
 		}