Commit 059a029c authored by 冯超鹏's avatar 冯超鹏

Merge branch 'develos'

parents cbb72e97 23f5a4df
Pipeline #202 canceled with stages
......@@ -8,6 +8,7 @@ use Illuminate\Http\Request;
use App\Models\AlarmOrder;
use Illuminate\Support\Facades\DB;
use App\Models\AlarmOrderSchedule;
use Illuminate\Support\Facades\Auth;
class AlarmOrderController extends Controller
{
......@@ -21,6 +22,9 @@ class AlarmOrderController extends Controller
if($this->isadmin()) {
$limit = 20;
$offset = $limit * ($request->input('page') - 1);
if($request->input('isuser') == 'user'){
$isuser = ['u.id','=',Auth::id()];
}
$orders = AlarmOrder::selectRaw('
FROM_UNIXTIME(r.starttime) AS start_time,
FROM_UNIXTIME(r.endtime) AS end_time,
......@@ -35,6 +39,7 @@ class AlarmOrderController extends Controller
->leftjoin('users AS u', 'alarm_order.user_id', '=', 'u.id')
->leftjoin('status AS s', 's.id', '=', 'alarm_order.reportpolice_id')
->offset($offset)
->where($isuser)
->limit($limit)
->get()->toArray();
return $this->jsonSuccessData($orders);
......
......@@ -39,13 +39,8 @@ class ZehongTcpController extends Controller
if ($totcp == "暂无设备"){
return $totcp;
}
if($totcp['nd'] < 999 ){
$totcp['nd'] = '0' . $totcp['nd'];
}
if($totcp['nd'] < 99 ){
$totcp['nd'] = '0' . $totcp['nd'];
}
$totcpdata = $totcp['devicenum'] .$totcp['devicepolice'] .$totcp['nd'] . $totcp['shutoff_status'] . $devicechongqi . $devicezijian;
$totcpdata = $totcp['devicenum'] . $totcp['shutoff_status'] . $devicechongqi . $devicezijian;
$crcdata = $this->getPrc($totcpdata);
return $totcpdata .$crcdata ;
}
......@@ -92,7 +87,7 @@ class ZehongTcpController extends Controller
if($data != []){
$datainfo = DB::table('device')
->where('devicenum','=',$data['id'])
->update(['nd'=>intval($data['np']),'shutoff_status'=>$data['famen'],'devicepolice'=>$data['status'] == 0 ? '1' : $data['status']]);
->update(['nd'=>intval($data['np']),'shutoff_status'=>$data['famen'],'devicepolice'=>$data['status'] == 0 ? '1' : $data['status'],'update_time'=>time()]);
$todata = DB::table('device')
->where('devicenum','=',$data['id'])
->select('devicenum','nd','shutoff_status','devicepolice')
......
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