|
@@ -27,70 +27,50 @@ class TestsController {
|
|
|
|
|
|
public function test()
|
|
|
{
|
|
|
- $url = 'https://openapi.lechange.cn:443/openapi/accessToken' ;
|
|
|
+ //宁煤洗选重复摄像头
|
|
|
+ // $this->xixuan_repeat();
|
|
|
|
|
|
-//当前的UTC时间戳
|
|
|
- $time= strtotime(date('Y-m-d H:i:s',time()));
|
|
|
-
|
|
|
-//随机字符串
|
|
|
- $nonce = md5(time());
|
|
|
-
|
|
|
-//授权信息之appid
|
|
|
- $appId='lce9762cfccca541df';
|
|
|
-
|
|
|
-//授权信息之appSecret
|
|
|
- $appSecret='58b95cc58f3948a782cd50ff8a1931';
|
|
|
-
|
|
|
-
|
|
|
-//拼接计算“签名原始串”
|
|
|
- $signStr="time:$time,nonce:$nonce,appSecret:$appSecret";
|
|
|
-
|
|
|
-//计算摘要 sign
|
|
|
- $sign=md5($signStr);
|
|
|
-
|
|
|
-//业务参数
|
|
|
- $params = [
|
|
|
-
|
|
|
- ];
|
|
|
-
|
|
|
-//组装调用接口的body体内容
|
|
|
- $data = json_encode([
|
|
|
- 'system'=>
|
|
|
- [
|
|
|
- 'ver'=>'1.0',
|
|
|
- 'sign'=>$sign,
|
|
|
- 'appId'=>$appId,
|
|
|
- 'time'=>$time,
|
|
|
- 'nonce'=>$nonce
|
|
|
- ],
|
|
|
- 'params'=>empty($params)? new stdClass():$params,
|
|
|
- 'id'=>'88'
|
|
|
- ]);
|
|
|
-
|
|
|
-//http调用
|
|
|
- $ret = $this->curl_post($data, $url);
|
|
|
- $utf8 = iconv('utf-8', 'UTF-8', $ret);
|
|
|
-//调用后返回输出
|
|
|
- echo $nonce.'result:<br>'.nl2br($utf8 ).'<br>';
|
|
|
+ //新接入摄像头接口测试
|
|
|
+ $this->new_joggle();
|
|
|
+ }
|
|
|
|
|
|
+ //新接入摄像头接口测试
|
|
|
+ public function new_joggle(){
|
|
|
+ $mine_id_list = MineListExt::where('is_hak', 1)->pluck('mine_id')->all();
|
|
|
+// dd($mine_id_list);
|
|
|
+ MineServices::getHaiKangArea(4569, CameraEnum::REQUEST_TYPE_LOCAL);//配合修改mineext和haikangcontroller里打印
|
|
|
+ dd(123);
|
|
|
}
|
|
|
|
|
|
- function curl_post($data,$url)
|
|
|
- {
|
|
|
- $ch = curl_init();
|
|
|
- $res= curl_setopt ($ch, CURLOPT_URL,$url);
|
|
|
- var_dump($res);
|
|
|
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
|
|
|
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
|
|
|
- curl_setopt ($ch, CURLOPT_HEADER, 0);
|
|
|
- curl_setopt($ch, CURLOPT_POST, 1);
|
|
|
- curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
|
|
|
- curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
|
|
|
- $result = curl_exec ($ch);
|
|
|
- curl_close($ch);
|
|
|
- if ($result == NULL) {
|
|
|
- return 0;
|
|
|
+ //宁煤洗选重复摄像头
|
|
|
+ public function xixuan_repeat(){
|
|
|
+ $mine_all = DB::table('mine_list')->where('deleted_at',null)->get();//所有区域
|
|
|
+ //宁煤下各矿在离线数量
|
|
|
+ $mine_list = DB::table('mine_list')->where('parent_id',968)->where('deleted_at',null)->get();
|
|
|
+ $mine_use = [];//宁煤下每个矿所有区域
|
|
|
+ foreach($mine_all as $key=>$value){
|
|
|
+ if(count(explode('|',$value->degree)) > 1){
|
|
|
+ if(explode('|',$value->degree)[0] == 968 && explode('|',$value->degree)[1] == 2429){
|
|
|
+ $mine_use[] = $value->id;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $total = DB::table('camera_list')
|
|
|
+ ->select('camera_list.camera_name','camera_list.camera_status','mine_list.title')
|
|
|
+ ->leftJoin('mine_list','mine_list.id','=','camera_list.mine_id')
|
|
|
+ ->whereIn('camera_list.mine_id',$mine_use)
|
|
|
+ ->where('camera_list.deleted_at',null)
|
|
|
+ ->where('mine_list.deleted_at',null)
|
|
|
+ ->orderBy('mine_list.title')
|
|
|
+ ->get();
|
|
|
+ // dd($total);
|
|
|
+ $aa = [];
|
|
|
+ foreach($total as $k=>$v){
|
|
|
+ $aa[] = $v->camera_name;
|
|
|
}
|
|
|
- return $result;
|
|
|
+ $unique_arr = array_unique ( $aa );
|
|
|
+ // dd($unique_arr);
|
|
|
+ $repeat_arr = array_diff_assoc ( $aa, $unique_arr );
|
|
|
+ return $repeat_arr;
|
|
|
}
|
|
|
}
|