作者 何书鹏
1 个管道 的构建 通过 耗费 0 秒

商家广告模板消息

... ... @@ -155,12 +155,27 @@ class StoreInform extends Backend
"remark" => ['点击领取红包','#FF0000'],
);
$url1 = config('option.vue_url') . '/shopdetails?id='.$store->id;
foreach (array_unique($user_id_arr) as $user_id) {
// 用户去重
$user_id_arr = array_unique($user_id_arr);
// 随机红包数量用户
if(count($user_id_arr) > $row->number){
$random_keys = array_rand($user_id_arr,$row->number);
if(is_array($random_keys)){
$new_user_id_arr = [];
foreach ($random_keys as $rand) {
$new_user_id_arr[] = $user_id_arr[$rand];
}
}else{
$new_user_id_arr[] = $user_id_arr[$random_keys];
}
}else{
$new_user_id_arr = $user_id_arr;
}
foreach ($new_user_id_arr as $user_id) {
$openid1 = Db::name('third')->where('user_id',$user_id)->value('openid');
$this->wxsendmessage($openid1,$send_data1,config('option.template')['store_inform'],$url1);
}
}
$this->wxsendmessage($openid,$send_data,config('option.template')['ad_pass'],$url);
}
}
if($params['status'] == 4) {
... ...