Browse Source

智能门锁-设备实时上报数据接口优化3

master
wanghongjun 2 years ago
parent
commit
b00ec77547
  1. 4
      application/api/controller/Smartlock.php
  2. 12
      application/common/SzxfjkSdk/SmartLocks.php

4
application/api/controller/Smartlock.php

@ -82,9 +82,9 @@ class Smartlock extends Base
$param = array_merge($deviceInfo,$deviceStatus);
$pushRes = SmartLocks::TimingDataPush($param);
if (!$pushRes['status']) throw new \Exception($pushRes['msg']);
#if (!$pushRes['status']) throw new \Exception($pushRes['msg']);
return $this->jsonSuccess();
return $this->jsonSuccess('成功',$pushRes);
} catch (\Exception $exception) {
return $this->jsonError($exception->getMessage());
}

12
application/common/SzxfjkSdk/SmartLocks.php

@ -52,13 +52,13 @@ class SmartLocks
],//数据内容
];
$result = self::curlPost($requestUrl, $data);
return $result = self::curlPost($requestUrl, $data);
if (!$result['code']) {
return ['status' => 1,'msg' => '推送成功'];
}
return ['status' => 0,'msg' => '推送失败'];
// if (!$result['code']) {
// return ['status' => 1,'msg' => '推送成功'];
// }
//
// return ['status' => 0,'msg' => '推送失败'];
}
/**

Loading…
Cancel
Save