OfficialImgtextUrls.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace App\Modules\OfficialAccount\Models;
  3. use Illuminate\Database\Eloquent\Model;
  4. class OfficialImgtextUrls extends Model
  5. {
  6. protected $tables = 'official_imgtext_urls';
  7. protected $fillable = ['content_source_url','book_name','chapter_sequence','img_url','title','content','author','digest','gzh_app_id','thumb_media_id','distribution_channel_id','send_orders_id','send_orders_name','send_orders_url','del_flag'];
  8. static function officialImgtextUrlsByChannelId($distribution_channel_id)
  9. {
  10. return self::where('distribution_channel_id', isset($distribution_channel_id) ? $distribution_channel_id : '')->where('del_flag',0)->orderBy('id','desc')->paginate();
  11. }
  12. static function getOfficialImgTxtUrlByBookName($distribution_channel_id,$book_name)
  13. {
  14. return self::where(['distribution_channel_id'=>isset($distribution_channel_id) ? $distribution_channel_id : '','book_name'=>isset($book_name) ? $book_name : ''])->where('del_flag',0)->orderBy('id','desc')->paginate();
  15. }
  16. static function officialImgtextUrlsById($id)
  17. {
  18. return self::where('id', isset($id) ? $id : '')->first();
  19. }
  20. }