菜谱项目

Category.php 454B

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