作者 Cool
1 个管道 的构建 通过 耗费 1 秒

Merge branch 'master' of http://114.215.101.231:8099/guosheng/community into Branch_liuzhen

... ... @@ -141,13 +141,14 @@ class StoreInform extends Backend
"keyword2" => '审核通过',
"remark" => ['点击查看详情','#FF0000'],
);
$store = $row->store;
$house_ids = trim($store->house_ids,',');
// 推广社区
$house_ids = trim($row->house_ids,',');
// 该店铺投放广告的小区业主ID
$user_id_arr = \app\api\model\UserHouse::where('status',2)
->where('house_id','in',$house_ids)
->column('user_id');
if(!empty($user_id_arr)){
$store = $row->store;
$send_data1 = array(
"first" => '你家小区附近有商家发福利啦,快来领取!',
"keyword1" => $store->store_name,
... ... @@ -155,12 +156,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) {
... ...