|
@@ -39,10 +39,18 @@ class EasemobJob implements ShouldQueue
|
|
public function handle()
|
|
public function handle()
|
|
{
|
|
{
|
|
//
|
|
//
|
|
- $info = DB::table('mt_message')->where('id',$this->msgid)->first();
|
|
|
|
|
|
+ $info = DB::table('mt_message')->where('id',$this->msgid)->where('dispatch_status',0)->first();
|
|
|
|
+ if(!empty($info)){
|
|
|
|
+ $easemob = new Easemob();
|
|
|
|
+ $rs = $easemob->push_text($info->user_id,$info->title,$info->content);
|
|
|
|
+
|
|
|
|
+ $update = [
|
|
|
|
+ 'dispatch_status' => 1,
|
|
|
|
+ ];
|
|
|
|
+
|
|
|
|
+ DB::table('mt_message')->where('id',$this->msgid)->update($update);
|
|
|
|
+ }
|
|
|
|
|
|
- $easemob = new Easemob();
|
|
|
|
- $rs = $easemob->push_text($info->user_id,$info->title,$info->content);
|
|
|
|
/*echo '<pre>';
|
|
/*echo '<pre>';
|
|
var_dump($rs);*/
|
|
var_dump($rs);*/
|
|
|
|
|