菜谱项目

Notice.php 497B

12345678910111213141516171819202122232425
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: zhangda
  5. * Date: 2018/1/11
  6. * Time: 下午4:35
  7. */
  8. namespace App\Models;
  9. use Illuminate\Database\Eloquent\Model;
  10. class Notice extends Model
  11. {
  12. protected $table = 'notice';
  13. public $timestamps = false;
  14. public static function getNoticeByChannelId($channel_id, $type = 1)
  15. {
  16. $data = self::select('content', 'title', 'url')->where(['channel_id' => $channel_id, 'status' => 1, 'type' => $type])->get();
  17. return $data;
  18. }
  19. }