|
|
|
@ -1,24 +1,30 @@ |
|
|
|
<?php |
|
|
|
|
|
|
|
namespace app\api\controller\passenger; |
|
|
|
namespace app\api\controller\pass; |
|
|
|
|
|
|
|
use app\api\controller\Controller; |
|
|
|
|
|
|
|
use think\Db; |
|
|
|
|
|
|
|
class PassengerFlow extends Controller |
|
|
|
class Passcc extends Controller |
|
|
|
{ |
|
|
|
|
|
|
|
public function test() { |
|
|
|
echo 1111; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 分时时间段接口 <首页-客流趋势> |
|
|
|
* @return false|string |
|
|
|
* @return array |
|
|
|
* @throws \think\db\exception\DataNotFoundException |
|
|
|
* @throws \think\db\exception\ModelNotFoundException |
|
|
|
* @throws \think\exception\DbException |
|
|
|
*/ |
|
|
|
public function allGroupTimeNum($granularity) { |
|
|
|
public function allGroupTimeNum() { |
|
|
|
|
|
|
|
$granularity = $this->request->param('granularity'); |
|
|
|
|
|
|
|
$granularity = $this->postData('granularity'); |
|
|
|
if (empty($granularity)) $this->renderError('date参数不能为空'); |
|
|
|
if (empty($granularity)) return $this->renderError('date参数不能为空'); |
|
|
|
|
|
|
|
$allTimeData = []; |
|
|
|
$groupsData = []; |
|
|
|
@ -39,7 +45,8 @@ class PassengerFlow extends Controller |
|
|
|
$groupsData = $data['groupsData']; |
|
|
|
} |
|
|
|
|
|
|
|
$this->renderSuccess(['allTimeData' => $allTimeData, 'groupsData' => $groupsData]); |
|
|
|
$data = ['allTimeData' => $allTimeData, 'groupsData' => $groupsData]; |
|
|
|
return $this->renderSuccess(compact('data')); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
@ -98,7 +105,7 @@ class PassengerFlow extends Controller |
|
|
|
|
|
|
|
/** |
|
|
|
* 总览总数据接口 <首页-中间部分总览> |
|
|
|
* @return false|string |
|
|
|
* @return array |
|
|
|
* @throws \think\db\exception\DataNotFoundException |
|
|
|
* @throws \think\db\exception\ModelNotFoundException |
|
|
|
* @throws \think\exception\DbException |
|
|
|
@ -123,12 +130,12 @@ class PassengerFlow extends Controller |
|
|
|
$val['noRepeatInNum'] = formatNumber($val['noRepeatInNum']); |
|
|
|
} |
|
|
|
|
|
|
|
$this->renderSuccess($returnData); |
|
|
|
return $this->renderSuccess(compact('returnData')); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 查询最新客流统计组实时数据 <各场管实施实时进馆人数> |
|
|
|
* @return false|string |
|
|
|
* @return array |
|
|
|
* @throws \think\db\exception\DataNotFoundException |
|
|
|
* @throws \think\db\exception\ModelNotFoundException |
|
|
|
* @throws \think\exception\DbException |
|
|
|
@ -149,12 +156,12 @@ class PassengerFlow extends Controller |
|
|
|
$val['proportion'] = (round($val['allEnter']/$sumAllEnter,2) * 100) ."%"; |
|
|
|
} |
|
|
|
|
|
|
|
$this->renderSuccess($returnData); |
|
|
|
return $this->renderSuccess(compact('returnData')); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 今日各场馆人数趋势 |
|
|
|
* @return false|string |
|
|
|
* @return array |
|
|
|
* @throws \think\db\exception\DataNotFoundException |
|
|
|
* @throws \think\db\exception\ModelNotFoundException |
|
|
|
* @throws \think\exception\DbException |
|
|
|
@ -174,7 +181,8 @@ class PassengerFlow extends Controller |
|
|
|
if (!isset($returnData[$value['groupName']][$allTimeData[$date]])) $returnData[$value['groupName']][$date] = 0; |
|
|
|
$returnData[$value['groupName']][$date] += $value['flowInNum']; |
|
|
|
} |
|
|
|
$this->renderSuccess($returnData); |
|
|
|
|
|
|
|
return $this->renderSuccess(compact('returnData')); |
|
|
|
} |
|
|
|
|
|
|
|
} |