...
|
...
|
@@ -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);
|
|
|
// 随机红包数量用户
|
|
|
$new_user_id_arr = [];
|
|
|
if(count($user_id_arr) > $row->number){
|
|
|
$random_keys = array_rand($user_id_arr,$row->number);
|
|
|
if(is_array($random_keys)){
|
|
|
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) {
|
...
|
...
|
|