浏览代码

更新2. 数据中心 - 租赁金额费用明细
筛选条件,按项目筛选的时候,没有把中铁二局 隐藏掉

ChenWuJie 4 年之前
父节点
当前提交
83b3bb69ec

+ 1 - 1
app/Http/Controllers/Api/mini/DataController.php

xqd
@@ -353,7 +353,7 @@ class DataController extends BaseController
     {
         $items = Order::where('type', 1);
         $date = $request->input('date');
-        $project_id = $request->input('project_id') ? $request->input('project_id') : Project::first()->id;
+        $project_id = $request->input('project_id') ? $request->input('project_id') : Project::where('id','>',1)->first()->id;
         $project = Project::find($project_id);
         $items = $items->where('project_id', $project->id);
         $sort_type = $request->input('sort_type') == 'year' ? 'year' : 'month';

+ 1 - 1
app/Http/Controllers/Api/mini/ProjectController.php

xqd
@@ -99,7 +99,7 @@ class ProjectController extends BaseController
     public function getAll(Request $request)
     {
         if($request->input('type') == 'drop_menu') {
-            $items = $this->model->select('name as text', 'id as value')->get();
+            $items = $this->model->where('id','>',1)->select('name as text', 'id as value')->orderBy('value')->get();
             $items = $items->prepend(collect(['text' => '请选择项目', 'value' => '']));
             return $this->success(['data' => $items]);
         }