|
|
@@ -15,11 +15,6 @@ class InformAdminClass extends BaseClass
|
|
|
|
|
|
public static $baseFile = '\biz\message\models\InformAdmin';
|
|
|
|
|
|
- public static function goodsSoldInform($params, $adminShop, $TMList)
|
|
|
- {
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
//增加通知员工 shish
|
|
|
public static function addInform($params, $adminShop, $type, $TMList)
|
|
|
{
|
|
|
@@ -144,57 +139,43 @@ class InformAdminClass extends BaseClass
|
|
|
{
|
|
|
self::add($data);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
//订单完成通知店长 shish 2020.3.19
|
|
|
public static function sendComplete($order, $merchant)
|
|
|
{
|
|
|
$merchantId = $merchant['id'];
|
|
|
- $adminList = AdminClass::getAdminList($merchantId);
|
|
|
- if (empty($adminList)) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- $remindUserIds = [];
|
|
|
- foreach ($adminList as $admin) {
|
|
|
- $remind = $admin['remind'];
|
|
|
- if ($remind == 1) {
|
|
|
- $remindUserIds[] = $admin['userId'];
|
|
|
+ $orderId = $order['id'];
|
|
|
+ $adminList = AdminClass::getRemindAdmin($merchantId);
|
|
|
+ $tm = xhTMessageService::getList($merchantId);
|
|
|
+ $shortTempId = 'OPENTM201205968';//订单送达通知
|
|
|
+ $tempId = $tm[$shortTempId];
|
|
|
+ if (!empty($adminList)) {
|
|
|
+ foreach ($adminList as $admin) {
|
|
|
+ if (isset($admin['subscribe']) && $admin['subscribe'] == 1) {
|
|
|
+ $openId = $admin['openId'];
|
|
|
+ $miniOpenId = $admin['miniOpenId'];
|
|
|
+ $url = Yii::$app->params['shopDomain'] . "/#/admin/order/detail?id=" . $order['id'];
|
|
|
+ $url = httpUtil::becomeHttps($url);
|
|
|
+ $data = [
|
|
|
+ "touser" => $openId,
|
|
|
+ "template_id" => $tempId,
|
|
|
+ "url" => $url,
|
|
|
+ "data" => [
|
|
|
+ "first" => ["value" => '客户订单已送达', "color" => "#173177"],
|
|
|
+ "keyword1" => ["value" => (string)$order['orderSn'], "color" => "#173177"],
|
|
|
+ "keyword2" => ["value" => $order['bookName'], "color" => "#173177"],
|
|
|
+ "keyword3" => ["value" => '已送达', "color" => "#173177"],
|
|
|
+ "remark" => ["value" => '', "color" => "#173177"]
|
|
|
+ ]
|
|
|
+ ];
|
|
|
+ if (!empty($miniOpenId)) {
|
|
|
+ $data['miniprogram']['appid'] = $merchant['miniAppId'];
|
|
|
+ $data['miniprogram']['pagepath'] = 'admin/order/detail?id=' . $orderId;
|
|
|
+ }
|
|
|
+ wxUtil::sendTaskInform($data, $merchant);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- if (empty($remindUserIds)) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- $remindUserIds = array_filter(array_unique($remindUserIds));
|
|
|
- if (empty($remindUserIds)) {
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
-// $userList = UserClass::getByIds($remindUserIds);
|
|
|
-//
|
|
|
-// $allTM = xhTMessageService::getList($merchantId);
|
|
|
-// $shortTempId = 'OPENTM201205968';//订单送达通知
|
|
|
-// $tempId = $allTM[$shortTempId];
|
|
|
-//
|
|
|
-// foreach ($userList as $user) {
|
|
|
-// if (isset($user['subscribe']) && $user['subscribe'] == 1) {
|
|
|
-// $openId = $user['openId'];
|
|
|
-// $url = Yii::$app->params['shopDomain'] . "/#/admin/order/detail?id=" . $order['id'];
|
|
|
-// $url = httpUtil::becomeHttps($url);
|
|
|
-// $data = [
|
|
|
-// "touser" => $openId,
|
|
|
-// "template_id" => $tempId,
|
|
|
-// "url" => $url,
|
|
|
-// "data" => [
|
|
|
-// "first" => ["value" => '客户订单已送达', "color" => "#173177"],
|
|
|
-// "keyword1" => ["value" => (string)$order['orderSn'], "color" => "#173177"],
|
|
|
-// "keyword2" => ["value" => $order['bookName'], "color" => "#173177"],
|
|
|
-// "keyword3" => ["value" => '已送达', "color" => "#173177"],
|
|
|
-// "remark" => ["value" => '', "color" => "#173177"]
|
|
|
-// ]
|
|
|
-// ];
|
|
|
-// wxUtil::sendTaskInform($data, $merchant);
|
|
|
-// }
|
|
|
-// }
|
|
|
-
|
|
|
}
|
|
|
|
|
|
}
|