|
@@ -21,7 +21,6 @@ class queue_logic
|
|
|
else {
|
|
|
$url = "{$url}{$api}?token={$token}";
|
|
|
}
|
|
|
-
|
|
|
$resp = http_post_data($url,json_encode($params));
|
|
|
$resp = json_decode($resp,true);
|
|
|
return $resp;
|
|
@@ -35,7 +34,7 @@ class queue_logic
|
|
|
$token = $this->login($params['req_url'],$params['key']);
|
|
|
$resp = $this->reqest($params['req_url'] ,'/open_box', $postData,$token);
|
|
|
|
|
|
- $this->sync_return($params['ret_queue'],$resp);
|
|
|
+ $this->sync_return($params['ret_queue'],$params['method'],$resp);
|
|
|
}
|
|
|
|
|
|
public function LockCabinet($params) {
|
|
@@ -47,45 +46,16 @@ class queue_logic
|
|
|
$token = $this->login($params['req_url'],$params['key']);
|
|
|
$resp = $this->reqest($params['req_url'] ,'/open_box', $postData,$token);
|
|
|
|
|
|
- $this->sync_return($params['ret_queue'],$resp);
|
|
|
+ $this->sync_return($params['ret_queue'],$params['method'],$resp);
|
|
|
}
|
|
|
|
|
|
|
|
|
- public function LockBox($params) {
|
|
|
- $box_list[] = $params['box_number'];
|
|
|
- $postData['cabinet_code'] = $params['cabinet_number'];
|
|
|
- $postData['box_position_list'] = $box_list;
|
|
|
- $postData['delay_time'] = 0;
|
|
|
-
|
|
|
- $return = http_post($params['req_url'] , $postData);
|
|
|
- $return['code'] = 'ok';
|
|
|
- if($return['code'] != 0){
|
|
|
- $return['value'] = 'error';
|
|
|
- }
|
|
|
-
|
|
|
- $this->sync_return($params['ret_queue'] ,$return);
|
|
|
- }
|
|
|
-
|
|
|
- public function UnLockBox($params) {
|
|
|
- $box_list[] = $params['box_number'];
|
|
|
- $postData['cabinet_code'] = $params['cabinet_number'];
|
|
|
- $postData['box_position_list'] = $box_list;
|
|
|
- $postData['delay_time'] = 0;
|
|
|
-
|
|
|
- $return = http_post($params['req_url'] , $postData);
|
|
|
- $return['code'] = 'ok';
|
|
|
- if($return['code'] != 0){
|
|
|
- $return['value'] = 'error';
|
|
|
- }
|
|
|
- $this->sync_return($params['ret_queue'] , $return);
|
|
|
- }
|
|
|
|
|
|
- private function sync_return($queue_name,$params){
|
|
|
+ private function sync_return($queue_name,$key,$params){
|
|
|
global $config;
|
|
|
$host = ['net_queue']['host'];
|
|
|
$port = $config['net_queue']['port'];
|
|
|
|
|
|
- $worker = new QueueDB($queue_name,$host,$port);
|
|
|
- $worker->push($params);
|
|
|
+ QueueClient::push($queue_name,$host ,$port ,$key,$params);
|
|
|
}
|
|
|
}
|