shish 6 anni fa
parent
commit
c39a077c78

+ 11 - 9
app/business/controllers/BaseController.php

@@ -25,8 +25,18 @@ class BaseController extends PublicController
 	{
 		//token验证
 		$adminId = jwt::getLoginId();
+		$merchantId = 0;
 		if (empty($adminId)) {
 			$this->validate = false;
+		} else {
+			$admin = AdminService::getById($adminId);
+			if (empty($admin)) {
+				util::fail('帐号无效');
+			}
+			$merchantId = $admin['merchantId'];
+			if (empty($merchantId)) {
+				util::fail('没有找到商家信息');
+			}
 		}
 		//游客可以访问的方法
 		if (in_array($action->id, $this->withoutLogin)) {
@@ -35,14 +45,6 @@ class BaseController extends PublicController
 		if ($this->validate == false) {
 			util::notLogin();
 		}
-		$admin = AdminService::getById($adminId);
-		if (empty($admin)) {
-			util::fail('帐号无效');
-		}
-		$merchantId = $admin['merchantId'];
-		if (empty($merchantId)) {
-			util::fail('没有找到商家信息');
-		}
 		$merchant = MerchantService::getMerchantById($merchantId);
 		$merchantExtend = MerchantExtendService::getByMerchantId($merchantId);
 		$this->admin = $admin;
@@ -114,6 +116,6 @@ class BaseController extends PublicController
 		$service::deleteById($id);
 		util::success([], '删除成功');
 	}
-
+	
 }
 

+ 2 - 2
app/business/controllers/TestController.php

@@ -93,8 +93,8 @@ class TestController extends BaseController
 	//宝贝售出提醒 shish 2020.1.30
 	public function actionInform()
 	{
-		$merchant = MerchantService::getMerchantById(12359);
-		$order = OrderService::getById(214731);
+		$merchant = MerchantService::getMerchantById(12362);
+		$order = OrderService::getById(214810);
 		InformAdminClass::sendComplete($order, $merchant);
 	}
 

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

@@ -107,13 +107,17 @@ class InformAdminClass extends BaseClass
 		foreach ($adminList as $admin) {
 			$remind = $admin['remind'];
 			if ($remind == 1) {
-				$remindUserIds = $admin['userId'];
+				$remindUserIds[] = $admin['userId'];
 			}
 		}
+		if(empty($remindUserIds)){
+			return false;
+		}
 		$remindUserIds = array_filter(array_unique($remindUserIds));
 		if (empty($remindUserIds)) {
 			return false;
 		}
+		
 		$userList = UserClass::getByIds($remindUserIds);
 
 		$allTM = xhTMessageService::getList($merchantId);

+ 2 - 2
biz/order/classes/OrderClass.php

@@ -137,9 +137,9 @@ class OrderClass extends BaseClass
 		$user = UserClass::getById($userId);
 		$merchantId = $order['merchantId'];
 		$merchant = MerchantClass::getById($merchantId);
-		//InformUserClass::sendComplete($user, $order, $merchant);
+		InformUserClass::sendComplete($user, $order, $merchant);
 		//!!!通知待完成
-		//InformAdminClass::sendComplete($order, $merchant);
+		InformAdminClass::sendComplete($order, $merchant);
 	}
 	
 	//转化出送到时间 shish 2020.3.15