sendNotice.php 798 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace App\Admin\Actions\Community\Notice;
  3. use App\User;
  4. use Encore\Admin\Actions\BatchAction;
  5. use Illuminate\Database\Eloquent\Collection;
  6. class sendNotice extends BatchAction
  7. {
  8. public $name = '群发通知';
  9. public function handle(Collection $collection)
  10. {
  11. foreach ($collection as $model) {
  12. $openid = User::where('id',$model->id)->value('openid');
  13. if(empty($openid)) continue;
  14. }
  15. return $this->response()->success('Success message...')->refresh();
  16. }
  17. public function form()
  18. {
  19. $this->text('title','标题')->value('社区通州')->disable();
  20. $this->textarea('content','内容')->value('社区通州')->rows(4);
  21. $this->textarea('remark','备注')->value('社区通州')->rows(3);
  22. }
  23. }