|
|
|
@ -11,6 +11,8 @@ use think\Db; |
|
|
|
class Passcc extends Controller |
|
|
|
{ |
|
|
|
|
|
|
|
protected $libUrl = 'http://balib.cn:8999/CustCount/baoan/stat.json?key=baoan'; |
|
|
|
|
|
|
|
public function test() { |
|
|
|
echo 1111; |
|
|
|
} |
|
|
|
@ -214,6 +216,18 @@ class Passcc extends Controller |
|
|
|
$returnData[] = $val; |
|
|
|
} |
|
|
|
|
|
|
|
$result = curlPost($this->libUrl); |
|
|
|
$libData = json_decode($result,true); |
|
|
|
|
|
|
|
$libProportion = $libData['today']['incount'] > 0 ? round($libData['today']['incount']/$threshold,2) : 0; |
|
|
|
$returnData[] = [ |
|
|
|
'allEnter' => '0', |
|
|
|
'proportion' => ($libProportion * 100) . "%", |
|
|
|
'congestion' => Pass::getPassType($libProportion), |
|
|
|
'groupId' => '', |
|
|
|
'groupName' => '图书馆' |
|
|
|
]; |
|
|
|
|
|
|
|
return $this->renderSuccess(compact('returnData')); |
|
|
|
} |
|
|
|
|
|
|
|
|