column('uid'); $adminList = array_unique($kefuIds); if (!is_array($adminList) || empty($adminList)) return false; foreach ($adminList as $uid) { try { $openid = WechatUser::uidToOpenid($uid); } catch (\Exception $e) { continue; } RoutineTemplateService::sendTemplate($openid, RoutineTemplateService::setTemplateId(RoutineTemplateService::ORDER_PAY_SUCCESS), '', $data); } } /** * 账户变动订阅消息 * $userinfo 用户消息 * */ public static function sendAccountChanges(array $data, $uid, $link = '') { RoutineTemplateService::sendTemplate(WechatUser::uidToOpenid($uid), RoutineTemplateService::setTemplateId(RoutineTemplateService::USER_BALANCE_CHANGE), $link, $data); } /**审核结果通知 * @param array $data * @param $uid * @param string $link */ public static function sendExamineResult(array $data, $uid, $link = '') { RoutineTemplateService::sendTemplate(WechatUser::uidToOpenid($uid), RoutineTemplateService::setTemplateId(RoutineTemplateService::EXAMINE_RESULT), $link, $data); } /** * 订单发货提醒 * @param int $oid * @param array $postageData * @return bool */ public static function sendOrderGoods(array $data, $uid, $link = '') { RoutineTemplateService::sendTemplate(WechatUser::uidToOpenid($uid), RoutineTemplateService::setTemplateId(RoutineTemplateService::ORDER_POSTAGE_SUCCESS), $link, $data); } /**订单收货提醒 * @param array $data * @param $uid * @param string $link */ public static function sendReceivingGoods(array $data, $uid, $link = '') { RoutineTemplateService::sendTemplate(WechatUser::uidToOpenid($uid), RoutineTemplateService::setTemplateId(RoutineTemplateService::ORDER_TAKE_SUCCESS), $link, $data); } /** * 退款成功发送消息 * @param array $order */ public static function sendOrderRefundSuccess($data = array(), $uid, $link = '') { RoutineTemplateService::sendTemplate(WechatUser::uidToOpenid($uid), RoutineTemplateService::setTemplateId(RoutineTemplateService::ORDER_REFUND_STATUS), $link, $data); } /** * 活动报名成功发送消息 * @param array $order */ public static function sendSignUpSuccess($data = array(), $uid, $link = '') { RoutineTemplateService::sendTemplate(WechatUser::uidToOpenid($uid), RoutineTemplateService::setTemplateId(RoutineTemplateService::ORDER_USER_SIGN_UP_SUCCESS), $link, $data); } /**开播提醒 * @param array $data * @param $uid * @param string $link */ public static function sendBroadcastReminder($data = array(), $uid, $link = '') { RoutineTemplateService::sendTemplate(WechatUser::uidToOpenid($uid), RoutineTemplateService::setTemplateId(RoutineTemplateService::LIVE_BROADCAST), $link, $data); } /**拼团进度提醒 * @param array $data * @param $uid * @param string $link */ public static function sendListProgress($data = array(), $uid, $link = '') { RoutineTemplateService::sendTemplate(WechatUser::uidToOpenid($uid), RoutineTemplateService::setTemplateId(RoutineTemplateService::PINK_ORDER_REMIND), $link, $data); } /**拼团成功提醒 * @param array $data * @param $uid * @param string $link */ public static function sendOrderSuccessfully($data = array(), $uid, $link = '') { RoutineTemplateService::sendTemplate(WechatUser::uidToOpenid($uid), RoutineTemplateService::setTemplateId(RoutineTemplateService::ORDER_USER_GROUPS_SUCCESS), $link, $data); } /**拼团失败提醒 * @param array $data * @param $uid * @param string $link */ public static function sendOrderFail($data = array(), $uid, $link = '') { RoutineTemplateService::sendTemplate(WechatUser::uidToOpenid($uid), RoutineTemplateService::setTemplateId(RoutineTemplateService::ORDER_USER_GROUPS_LOSE), $link, $data); } /**获取用户相关的订阅消息模版ID * @param $type * @param int $id * @return string */ public static function getTemplateIdList($type, $id = 0) { $list = RoutineTemplateModel::create_template($type, $id); $templateIds = implode(',', $list); return $templateIds; } }