SmmPost.php 796 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace App\Distributor\Repositories;
  3. use App\Models\SmmPost as Model;
  4. use Dcat\Admin\Repositories\EloquentRepository;
  5. class SmmPost extends EloquentRepository
  6. {
  7. /**
  8. * Model.
  9. *
  10. * @var string
  11. */
  12. protected $eloquentClass = Model::class;
  13. /*
  14. * 插入数据
  15. */
  16. public static function create($post,$sendTime,$imageVideoUrl)
  17. {
  18. $model = new Model();
  19. $model->send_type = $post['send_type'];
  20. $model->send_time = $sendTime;
  21. $model->message = $post['message'];
  22. $model->media_type = $post['media_type'];
  23. $model->account_ids = implode(',',$post['account_ids']);
  24. $model->image_video_url = $imageVideoUrl;
  25. $model->status = 0;
  26. $model->save();
  27. return $model->id;
  28. }
  29. }