shish 6 роки тому
батько
коміт
4a3a2e38d7

+ 1 - 1
biz/admin/classes/AdminClass.php

@@ -181,7 +181,7 @@ class AdminClass extends BaseClass
 	//取商家需要收款通知的全部员工 shish 2019.12.24
 	public static function getAllNoticeAdmin($merchantId)
 	{
-		$list = self::getAllByCondition(['merchantId' => $merchantId, 'delStatus' => 0, 'status' => 1], null, '*');
+		$list = self::getAllByCondition(['merchantId' => $merchantId, 'delStatus' => 0, 'status' => 1, 'remind' => 1], null, '*');
 		if (empty($list)) {
 			util::fail('此商家没有员工,请检查原因');
 		}

+ 2 - 68
biz/message/classes/InformAdminClass.php

@@ -24,21 +24,14 @@ class InformAdminClass extends BaseClass
 				break;
 			default:
 		}
-		$data = ['messageType' => 'inform', 'informWay' => 'wx', 'userType' => 'admin', 'id' => 1, 'mobile' => '15280215347'];
+		$data = ['messageType' => 'inform', 'informWay' => 'wx', 'userType' => 'admin', 'id' => 6, 'mobile' => '15280215347'];
 		$data = array_merge($data, $respond);
 		$producer = Yii::$app->rabbitmq->getProducer('producerInform');
 		$msg = serialize($data);
 		$producer->publish($msg, 'exInform', 'routeInform');
 	}
-
-	public static function incomeInform()
-	{
-		return [];
-	}
-	
 	
-	//宝贝售出通知 shish 2019.12.24
-	public static function goodsSoldInform($params, $admin, $TMList)
+	public static function incomeInform($params, $admin, $TMList)
 	{
 		$totalFee = 199;
 		$orderSn = '2051229823132466';
@@ -63,65 +56,6 @@ class InformAdminClass extends BaseClass
 		return $data;
 	}
 	
-	//门店收入提醒 shish 2019.12.24
-	public static function shopIncomeInformAdmin2($data, $merchantId = 0)
-	{
-		$TMList = xhTMessageService::getList($merchantId);
-		$adminList = AdminClass::getAllNoticeAdmin($merchantId);
-		$merchant = MerchantService::getById($merchantId);
-		$shortTempId = 'OPENTM207422813';//收入提醒
-		if (isset($TMList[$shortTempId]) == false) {
-			util::fail('没有找到公众号的消息模样:' . $shortTempId);
-		}
-		$tempId = $TMList[$shortTempId];
-		foreach ($adminList as $adminKey => $admin) {
-			$openId = $admin['openId'];
-			if (!empty($openId) && $admin['subscribe'] == 1) {
-				$data = ["touser" => $openId, "template_id" => $tempId,
-					"url" => Yii::$app->params['adminUrl'] . '/order/detail?id=' . $orderSn, "data" => [
-						"first" => ["value" => $userName . $payWay . '付款', "color" => "#173177"],
-						"keyword1" => ["value" => $totalFee . '元', "color" => "#173177"],
-						"keyword2" => ["value" => '客户付款', "color" => "#173177"],
-						"keyword3" => ["value" => date("Y-m-d H:i"), "color" => "#173177"],
-						"remark" => ["value" => "点击查看明细", "color" => "#173177"]]];
-				$respond = wxUtil::sendTaskInform($data, $merchant);
-				Yii::info('tm:' . json_encode($respond));
-			} else {
-				$mobile = $admin['mobile'];
-				$msg = "客户" . $userName . "付款" . $totalFee . '元';
-				sms::merchantSend($mobile, $msg, $merchant);
-			}
-		}
-	}
-	
-	//宝贝售出通知 shish 2019.12.24
-	public static function goodsSoldInform2($merchantId)
-	{
-		$TMList = xhTMessageService::getList($merchantId);
-		$merchant = MerchantService::getById($merchantId);
-		$shortTempId = 'OPENTM207422813';//收入提醒
-		$tempId = isset($TMList[$shortTempId]) ? $TMList[$shortTempId] : '';
-		foreach ($adminList as $adminKey => $admin) {
-			$openId = $admin['openId'];
-			if (!empty($openId) && $admin['subscribe'] == 1) {
-				$sendData = ["touser" => $openId, "template_id" => $tempId, "url" => Yii::$app->params['adminUrl'] . '/order/detail?id=' . $orderSn, "data" => [
-					"first" => ["value" => '您有宝贝售出哦!', "color" => "#173177"],
-					"keyword1" => ["value" => (string)$orderSn, "color" => "#173177"],
-					"keyword2" => ["value" => $orderName, "color" => "#173177"],
-					"keyword3" => ["value" => number_format($totalFee, 2) . '元', "color" => "#173177"],
-					"keyword4" => ["value" => number_format($totalFee, 2) . '元', "color" => "#173177"],
-					"keyword5" => ["value" => $userName, "color" => "#173177"],
-					"remark" => ["value" => '点此查看详细、编辑收花人信息。', "color" => "#173177"]]];
-				$respond = wxUtil::sendTaskInform($sendData, $merchant);
-				Yii::info('tm:' . json_encode($respond));
-			} else {
-				$mobile = $admin['mobile'];
-				$msg = "客户" . $userName . "付款" . $totalFee . '元';
-				sms::merchantSend($mobile, $msg, $merchant);
-			}
-		}
-	}
-	
 	//添加通知内容 shish 2020.1.8
 	public static function addData($data)
 	{

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

@@ -37,7 +37,7 @@ class InformAdminService extends BaseService
 	public static function consumeInformQueue($data)
 	{
 		//['messageType'=>'inform','informWay'=>'wx','userType'=>'admin','id'=>1,'mobile'=>'15280215347','tMessage'=>'','content'=>'','briefContent'=>'']
-		$informWay = $data['$informWay'];
+		$informWay = $data['informWay'];
 		$id = $data['id'];
 		$admin = AdminService::getAdminById($id);
 		$merchantId = $admin['merchantId'];
@@ -73,4 +73,5 @@ class InformAdminService extends BaseService
 		];
 		InformAdminClass::addData($informData);
 	}
+
 }

+ 0 - 2
common/components/rabbitmq/consumer/InformConsumer.php

@@ -25,14 +25,12 @@ class InformConsumer implements ConsumerInterface
 		//inform
 		//$messageType = $data['messageType'];
 		$userType = $data['userType'];
-		
 		if ($userType == 'user') {
 			InformUserService::consumeInformQueue($data);
 		}
 		if ($userType == 'admin') {
 			InformAdminService::consumeInformQueue($data);
 		}
-		
 		if ($data['status'] == 200) {
 			print_r('suceess ');
 			return ConsumerInterface::MSG_ACK;