作者 董瑞恩
1 个管道 的构建 通过 耗费 1 秒

order

@@ -166,19 +166,19 @@ class AesController extends HomeBaseController{ @@ -166,19 +166,19 @@ class AesController extends HomeBaseController{
166 * @url /portal/Aes/decryption 166 * @url /portal/Aes/decryption
167 * @method GET 167 * @method GET
168 * 168 *
169 - * @param name:MACAddress type:String require:1 default:无 other: desc:设备MAC地址 169 + * @param name:name type:String require:1 default:无 other: desc:设备名称
170 * @param name:key type:String require:1 default:无 other: desc:设备返回状态(未加密) 170 * @param name:key type:String require:1 default:无 other: desc:设备返回状态(未加密)
171 * @param name:type type:String require:1 default:无 other:1开锁返回指令,2状态返回指令 desc:命令类型 171 * @param name:type type:String require:1 default:无 other:1开锁返回指令,2状态返回指令 desc:命令类型
172 * 172 *
173 * @return code:1锁已开,0位锁已关,2为数据异常 173 * @return code:1锁已开,0位锁已关,2为数据异常
174 */ 174 */
175 - public function state($MACAddress,$key,$type){ 175 + public function state($name,$key,$type){
176 if ($type==1){ 176 if ($type==1){
177 if($key[0]=='0xff' && $key[4]=='0xef'){ 177 if($key[0]=='0xff' && $key[4]=='0xef'){
178 if ($key[3]=='0x01'){ 178 if ($key[3]=='0x01'){
179 //修改数据库设备状态 179 //修改数据库设备状态
180 try{ 180 try{
181 - Db::name('equipment')->where('mac_address',$MACAddress)->update(['use'=>1]); 181 + Db::name('equipment')->where('name',$name)->update(['use'=>1]);
182 }catch (\Exception $exception){ 182 }catch (\Exception $exception){
183 $this->apiResponse(301,'数据库状态更改失败,错误信息:'.$exception->getMessage()); 183 $this->apiResponse(301,'数据库状态更改失败,错误信息:'.$exception->getMessage());
184 } 184 }
@@ -192,7 +192,7 @@ class AesController extends HomeBaseController{ @@ -192,7 +192,7 @@ class AesController extends HomeBaseController{
192 }else if($type==2){ 192 }else if($type==2){
193 if($key[0]=='0xff' && $key[7]=='0xef'){ 193 if($key[0]=='0xff' && $key[7]=='0xef'){
194 if ($key[5]=='0x01'){ 194 if ($key[5]=='0x01'){
195 - Db::name('equipment')->where('mac_address',$MACAddress)->update(['electricity'=>0]); 195 + Db::name('equipment')->where('name',$name)->update(['electricity'=>0]);
196 } 196 }
197 if ($key[6]=='0x01'){ 197 if ($key[6]=='0x01'){
198 //修改数据库设备状态 198 //修改数据库设备状态
@@ -200,7 +200,7 @@ class AesController extends HomeBaseController{ @@ -200,7 +200,7 @@ class AesController extends HomeBaseController{
200 }else if($key[6]=='0x00'){ 200 }else if($key[6]=='0x00'){
201 //修改数据库设备状态 201 //修改数据库设备状态
202 try{ 202 try{
203 - Db::name('equipment')->where('mac_address',$MACAddress)->update(['use'=>0]); 203 + Db::name('equipment')->where('name',$name)->update(['use'=>0]);
204 }catch (\Exception $exception){ 204 }catch (\Exception $exception){
205 $this->apiResponse(301,'数据库状态更改失败,错误信息:'.$exception->getMessage()); 205 $this->apiResponse(301,'数据库状态更改失败,错误信息:'.$exception->getMessage());
206 } 206 }
@@ -28,15 +28,15 @@ class OrderController extends HomeBaseController{ @@ -28,15 +28,15 @@ class OrderController extends HomeBaseController{
28 * @method GET 28 * @method GET
29 * 29 *
30 * @param name:users_id type:String require:1 default:无 other: desc:用户id 30 * @param name:users_id type:String require:1 default:无 other: desc:用户id
31 - * @param name:mac_address type:String require:1 default:无 other: desc:设备Mac地址 31 + * @param name:name type:String require:1 default:无 other: desc:设备名称
32 * 32 *
33 */ 33 */
34 public function createOrder(){ 34 public function createOrder(){
35 $users_id=$this->request->param('users_id'); 35 $users_id=$this->request->param('users_id');
36 - $mac_address=$this->request->param('mac_address'); 36 + $name=$this->request->param('name');
37 $order=[ 37 $order=[
38 'order_no' => cmf_get_order_sn(), 38 'order_no' => cmf_get_order_sn(),
39 - 'mac_address' => $mac_address, 39 + 'eq_name' => $name,
40 'users_id' => $users_id, 40 'users_id' => $users_id,
41 'start_time' => time(), 41 'start_time' => time(),
42 'state' => 1 42 'state' => 1
@@ -120,7 +120,6 @@ class OrderController extends HomeBaseController{ @@ -120,7 +120,6 @@ class OrderController extends HomeBaseController{
120 * @method GET 120 * @method GET
121 * 121 *
122 * @param name:order_no type:String require:1 default:无 other: desc:订单号 122 * @param name:order_no type:String require:1 default:无 other: desc:订单号
123 - * @param name:openId type:String require:1 default:无 other: desc:openId  
124 * 123 *
125 * @return data:返回用于调用支付的参数 124 * @return data:返回用于调用支付的参数
126 */ 125 */