菜谱项目

Tag.php 439B

12345678910111213141516171819
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Model;
  4. use Illuminate\Support\Facades\DB;
  5. class Tag extends Model
  6. {
  7. protected $table = 'tag';
  8. public $timestamps = false;
  9. public static function selectTagList($categoryId, $status = 1)
  10. {
  11. $tagData = DB::table('tag')->select('id', 'name')->where('category_id', $categoryId)->where('status', $status)->get()->toArray();
  12. return $tagData;
  13. }
  14. }