1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <?php
- namespace App\Distributor\Repositories;
- use App\Models\SmmPost as Model;
- use Dcat\Admin\Repositories\EloquentRepository;
- class SmmPost extends EloquentRepository
- {
- /**
- * Model.
- *
- * @var string
- */
- protected $eloquentClass = Model::class;
- /*
- * 插入数据
- */
- public static function create($post,$sendTime,$imageVideoUrl)
- {
- $model = new Model();
- $model->send_type = $post['send_type'];
- $model->send_time = $sendTime;
- $model->message = $post['message'];
- $model->post_type = $post['post_type'];
- $model->account_ids = implode(',',$post['account_ids']);
- $model->image_video_url = $imageVideoUrl;
- $model->status = 0;
- $model->dist_id = getDistributorId();
- $model->save();
- return $model->id;
- }
- /*
- * 找出状态 0 的数据
- */
- public static function getWaitPost()
- {
- $model = new Model();
- $model = $model->where('status',0)->get();
- return $model;
- }
- public static function getPostById($id)
- {
- $model = new Model();
- $model = $model->where('id',$id)->first();
- return $model;
- }
- }
|