|
@@ -5,6 +5,7 @@ namespace App\Admin\Controllers;
|
|
use App\Admin\Actions\Notice\NoticeSend;
|
|
use App\Admin\Actions\Notice\NoticeSend;
|
|
use App\Models\Notice;
|
|
use App\Models\Notice;
|
|
use App\Models\User;
|
|
use App\Models\User;
|
|
|
|
+use App\Services\JPushService;
|
|
use Dcat\Admin\Form;
|
|
use Dcat\Admin\Form;
|
|
use Dcat\Admin\Grid;
|
|
use Dcat\Admin\Grid;
|
|
use Dcat\Admin\Show;
|
|
use Dcat\Admin\Show;
|
|
@@ -74,6 +75,23 @@ class NoticeController extends AdminController
|
|
$form->radio('users')->options([0=>'全部用户',1=>'男性用户',2=>"女性用户"])->default(0);
|
|
$form->radio('users')->options([0=>'全部用户',1=>'男性用户',2=>"女性用户"])->default(0);
|
|
$form->display('created_at');
|
|
$form->display('created_at');
|
|
$form->display('updated_at');
|
|
$form->display('updated_at');
|
|
|
|
+ $form->saved(function (){
|
|
|
|
+ //推送消息
|
|
|
|
+ JPushService::pushNotify([
|
|
|
|
+ //标题
|
|
|
|
+ 'title' => '测试',
|
|
|
|
+ //内容
|
|
|
|
+ 'content' => '测试',
|
|
|
|
+ //设备标识,跟设备相关
|
|
|
|
+ 'reg_id' => 'xxxxxxxxxxx',
|
|
|
|
+ //扩展字段
|
|
|
|
+ 'extras' => [
|
|
|
|
+ 'key' => 'value',
|
|
|
|
+ ],
|
|
|
|
+ //推送类型
|
|
|
|
+ 'type' => JPushService::PUSH_TYPE_ALL,
|
|
|
|
+ ]);
|
|
|
|
+ });
|
|
});
|
|
});
|
|
}
|
|
}
|
|
}
|
|
}
|