Commit 970051eb authored by 冯超鹏's avatar 冯超鹏

添加

parent daa80127
Pipeline #140 failed with stages
...@@ -62,7 +62,7 @@ class UinappHomeController extends Controller ...@@ -62,7 +62,7 @@ class UinappHomeController extends Controller
->get(); ->get();
} }
return $this->jsonSuccessData($data); return $this->jsonSuccessData($data);
}else{ } else {
return $this->jsonSuccessData(''); return $this->jsonSuccessData('');
} }
...@@ -96,6 +96,19 @@ class UinappHomeController extends Controller ...@@ -96,6 +96,19 @@ class UinappHomeController extends Controller
return $this->jsonSuccessData($data); return $this->jsonSuccessData($data);
} }
//返回设备类型和单位和介质
public function devicetype()
{
$gas = DB::table('gas')->get()->toArray();
$danwei = DB::table('danwei')->get()->toArray();
$devicetypecount = DB::table('device_type as t')
->leftjoin('device as d', 'd.dtype', '=', 't.tid')
->selectRaw('t.*,count(d.id) as counnum')
->groupBy('t.tid')
->get()->toArray();
return $this->jsonSuccessData(['devicetype' => $devicetypecount, 'gas' => $gas, 'danwei' => $danwei]);
}
//监测是否是汉子 //监测是否是汉子
private function isKanji($str) private function isKanji($str)
{ {
......
...@@ -125,6 +125,7 @@ Route::group(['middleware'=>'auth:api'],function (){ ...@@ -125,6 +125,7 @@ Route::group(['middleware'=>'auth:api'],function (){
Route::get('huinapphome/devicedatainfo/{id}','UinappHomeController@devicedatainfo');//设备详情 Route::get('huinapphome/devicedatainfo/{id}','UinappHomeController@devicedatainfo');//设备详情
Route::post('huinapphome/imitation','UinappHomeController@imitation');//模糊查询 Route::post('huinapphome/imitation','UinappHomeController@imitation');//模糊查询
Route::post('huinapphome/setseachdata','UinappHomeController@setseachdata');//指定查询 Route::post('huinapphome/setseachdata','UinappHomeController@setseachdata');//指定查询
Route::get('huinapphome/devicetype','UinappHomeController@devicetype');//测试添加页面选择数组数据
}); });
// Fake APIs // Fake APIs
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment