init
This commit is contained in:
68
application/api/controller_74GYL3/Runlog.php
Normal file
68
application/api/controller_74GYL3/Runlog.php
Normal file
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
namespace app\api\controller;
|
||||
|
||||
use app\api\model\BusDev;
|
||||
|
||||
use think\Controller;
|
||||
use think\Db;
|
||||
use think\Request;
|
||||
use think\Log;
|
||||
use app\api\controller\Vehicle;
|
||||
|
||||
header("Access-Control-Allow-Origin:*");
|
||||
header("Access-Control-Allow-Methods:GET, POST, OPTIONS, DELETE");
|
||||
header("Access-Control-Allow-Headers:DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type, Accept-Language, Origin, Accept-Encoding");
|
||||
|
||||
|
||||
class Runlog extends Common{
|
||||
|
||||
public function GetAbnormalLogList()
|
||||
{
|
||||
$log = db('abnormal_log')->limit(20)->where('status', 0)->select();
|
||||
return $this->sendSuccess($log);
|
||||
}
|
||||
|
||||
//WCS返回给WMS的消息
|
||||
public function AbnormalCallBack()
|
||||
{
|
||||
$param = request()->param();
|
||||
$param = json_decode($param['params'], true);
|
||||
Log::akzonobellog('INFO',"AbnormalCallBack...1");
|
||||
if ($param != null)
|
||||
{
|
||||
$type = $param['type'];
|
||||
$data = $param['content'];
|
||||
|
||||
$insert = [];
|
||||
$insert['type'] = $type;
|
||||
$insert['content'] = $data;
|
||||
$insert['createtime'] = date('Y-m-d H:i:s', time());
|
||||
$insert['status'] = 0;
|
||||
|
||||
$ret = db('abnormal_log')->insert($insert);
|
||||
}
|
||||
Log::akzonobellog('INFO',"AbnormalCallBack...2");
|
||||
return $this->sendSuccess("succeed");
|
||||
}
|
||||
|
||||
//WCS返回给WMS的消息
|
||||
public function UpdateAbnormalLog()
|
||||
{
|
||||
$param = request()->param();
|
||||
|
||||
if (isset($param['id']))
|
||||
{
|
||||
$id = $param['id'];
|
||||
|
||||
$update = [];
|
||||
$update['id'] = $id;
|
||||
$update['status'] = 1;
|
||||
$insert['handletime'] = date('Y-m-d H:i:s', time());
|
||||
|
||||
|
||||
$ret = db('abnormal_log')->update($update);
|
||||
}
|
||||
return $this->sendSuccess("succeed");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user