項目中需要對 項目狀態進行排序
在數據表中 設置 status字段 0:未開始 1:進行中 2:已結束 3:已結算
現需要對結果 按照
進行中》未開始》已結束》已結算
進行排序
$list = DB::table('projects')->orderByRaw("FIELD(status, " . implode(", ", [1, 0, 2, 3]) . ")")->orderBy("endTime",'desc')
->select('id','projnum','projname','starttime','endtime','bnftime','price','status','photo','labels','headpic')
->paginate($perPage);
orderByRaw("FIELD(status, " . implode(", ", [1, 0, 2, 3]) . ")")