interface for vehicle
This commit is contained in:
parent
84adb688b8
commit
2d2f14a132
@ -60,10 +60,4 @@ class GpsController extends BaseApiController
|
|||||||
return $this->fail($result['msg']);
|
return $this->fail($result['msg']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test() {
|
|
||||||
$res = push_message('170976fa8b98aae6535','这是条测试信息');
|
|
||||||
dump($res);
|
|
||||||
return !($res['code'] == 0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -17,8 +17,8 @@ namespace app\api\controller;
|
|||||||
use app\api\logic\LogisticsLogic;
|
use app\api\logic\LogisticsLogic;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 文章管理
|
* 物流管理
|
||||||
* Class ArticleController
|
* Class LogisticsController
|
||||||
* @package app\api\controller
|
* @package app\api\controller
|
||||||
*/
|
*/
|
||||||
class LogisticsController extends BaseApiController
|
class LogisticsController extends BaseApiController
|
||||||
|
28
app/api/controller/VehicleController.php
Normal file
28
app/api/controller/VehicleController.php
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||||
|
// | 开源版本可自由商用,可去除界面版权logo
|
||||||
|
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||||
|
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||||
|
// | 访问官网:https://www.likeadmin.cn
|
||||||
|
// | likeadmin团队 版权所有 拥有最终解释权
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | author: likeadminTeam
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace app\api\controller;
|
||||||
|
|
||||||
|
use app\api\logic\LogisticsLogic;
|
||||||
|
use app\api\logic\VehicleLogic;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆管理
|
||||||
|
* Class VehicleController
|
||||||
|
* @package app\api\controller
|
||||||
|
*/
|
||||||
|
class VehicleController extends BaseApiController
|
||||||
|
{
|
||||||
|
public array $notNeedLogin = [''];
|
||||||
|
}
|
@ -38,6 +38,11 @@ class InitMiddleware
|
|||||||
{
|
{
|
||||||
//获取控制器
|
//获取控制器
|
||||||
try {
|
try {
|
||||||
|
// $local_ip = $_SERVER['SERVER_ADDR'];
|
||||||
|
// $request_id = $request->ip();
|
||||||
|
// if($local_ip !== $request_id){
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
$controller = str_replace('.', '\\', $request->controller());
|
$controller = str_replace('.', '\\', $request->controller());
|
||||||
$controller = '\\app\\api\\controller\\' . $controller . 'Controller';
|
$controller = '\\app\\api\\controller\\' . $controller . 'Controller';
|
||||||
$controllerClass = invoke($controller);
|
$controllerClass = invoke($controller);
|
||||||
|
29
app/api/logic/VehicleLogic.php
Normal file
29
app/api/logic/VehicleLogic.php
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||||
|
// | 开源版本可自由商用,可去除界面版权logo
|
||||||
|
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||||
|
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||||
|
// | 访问官网:https://www.likeadmin.cn
|
||||||
|
// | likeadmin团队 版权所有 拥有最终解释权
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | author: likeadminTeam
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace app\api\logic;
|
||||||
|
|
||||||
|
|
||||||
|
use app\common\logic\BaseLogic;
|
||||||
|
use app\common\model\vehicle\Vehicle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆逻辑
|
||||||
|
* Class VehicleLogic
|
||||||
|
* @package app\api\logic
|
||||||
|
*/
|
||||||
|
class VehicleLogic extends BaseLogic
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
@ -28,5 +28,3 @@ Route::rule('userMessage','Logistics/sendMessageToApp','get');
|
|||||||
Route::rule('getCarInfo','Gps/getCarInfo','get');
|
Route::rule('getCarInfo','Gps/getCarInfo','get');
|
||||||
Route::rule('getCarStatus','Gps/getCarStatus','get');
|
Route::rule('getCarStatus','Gps/getCarStatus','get');
|
||||||
Route::rule('getCarHistory','Gps/getCarHistory','get');
|
Route::rule('getCarHistory','Gps/getCarHistory','get');
|
||||||
|
|
||||||
Route::rule('test','Gps/test','get');
|
|
@ -339,3 +339,31 @@ function push_message($reg_id,$message){
|
|||||||
return ['code'=>0,'msg'=>$e->getMessage(),'data'=>[]];
|
return ['code'=>0,'msg'=>$e->getMessage(),'data'=>[]];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
|
||||||
|
* 校验日期格式是否正确
|
||||||
|
|
||||||
|
*
|
||||||
|
|
||||||
|
* @param string $date 日期
|
||||||
|
|
||||||
|
* @param string $formats 需要检验的格式数组
|
||||||
|
|
||||||
|
* @return boolean
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
function checkDateIsValid($date, $formats = array("Y-m-d")) {
|
||||||
|
$unixTime = strtotime($date);
|
||||||
|
if (!$unixTime) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
//校验日期的有效性,只要满足其中一个格式就OK
|
||||||
|
foreach ($formats as $format) {
|
||||||
|
if (date($format, $unixTime) == $date) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user