| xqd
@@ -2,6 +2,8 @@
|
|
|
|
|
|
namespace App\Admin\Actions\Community\Notice;
|
|
|
|
|
|
+use App\Models\OrderPatient;
|
|
|
+use App\Models\Patient;
|
|
|
use App\User;
|
|
|
use EasyWeChat\Factory;
|
|
|
use Encore\Admin\Actions\BatchAction;
|
| xqd
@@ -16,7 +18,10 @@ class sendNotice extends BatchAction
|
|
|
$info = $collection->toArray();
|
|
|
$ids = array_unique(array_column($info,'id'));
|
|
|
foreach ($ids as $id) {
|
|
|
- $openid = User::where('id',$id)->value('openid');
|
|
|
+ $user_id = Patient::where('id',$id)->value('user_id');
|
|
|
+ if(empty($user_id)) continue;
|
|
|
+
|
|
|
+ $openid = User::where('id',$user_id)->value('openid');
|
|
|
$content = request('content');
|
|
|
$remark= request('remark');
|
|
|
$stime= request('stime');
|
| xqd
@@ -24,7 +29,6 @@ class sendNotice extends BatchAction
|
|
|
// $openid = 'oYmUA5A1OIqtpA1XSrw35tbjtv1w';
|
|
|
$service_arr = [1=>'儿保服务',2=>'疫苗接种服务'];
|
|
|
$service_name = $service_arr[$type];
|
|
|
-
|
|
|
//没有openid 直接不发送
|
|
|
if(empty($openid)) continue;
|
|
|
$template_arr = [
|
| xqd
@@ -38,7 +42,7 @@ class sendNotice extends BatchAction
|
|
|
$msg['remark'] = $remark;
|
|
|
$msg['service_name'] = $service_name;
|
|
|
|
|
|
- $this->send($openid,$tempId,$msg);
|
|
|
+ $res = $this->send($openid,$tempId,$msg);
|
|
|
}
|
|
|
|
|
|
return $this->response()->success('发送成功')->refresh();
|