Example #1
0
 public function update()
 {
     /**权限**/
     $this->verify_content_prms(array('_action' => 'manage'));
     /*******/
     if (!isset($this->input['id']) || !$this->input['id']) {
         $this->errorOutput("NO_ORDER_ID");
     }
     $id = (int) $this->input['id'];
     if (!isset($this->input['tracestep'])) {
         $this->errorOutput("NO_TRACE_STEP");
     }
     $tracestep = (int) $this->input['tracestep'];
     if (!array_key_exists($tracestep, $this->delivery_tracing_conf)) {
         $this->errorOutput("NO_TRACE_STEP_ILLEGAL");
     }
     $this->get_orderinfo($id);
     if ($this->Order['delivery_tracing'] > $tracestep && !$this->settings['is_back']) {
         $this->errorOutput("NO_TRACE_STEP_ERROR");
     }
     //
     if ($tracestep == 10 && $this->Order['integral_status']) {
         require_once ROOT_PATH . 'lib/class/members.class.php';
         //echo json_encode($order[0]);exit();
         $members = new members();
         if ($this->Order['pay_credits']) {
             $re = $members->finalFrozenCredit($this->Order['user_id'], $this->Order['order_id'], 'payments', 'OrderUpdate', $this->Order['pay_credits'], $this->Order['integral_status']);
         }
     }
     $params['ip'] = hg_getip();
     $params['user_id'] = $this->user['user_id'];
     $params['user_name'] = $this->user['user_name'];
     $params['create_time'] = TIMENOW;
     $params['update_time'] = TIMENOW;
     $params['order_id'] = $this->Order['id'];
     $params['order_code'] = $this->Order['order_id'];
     $params['tracestep'] = $tracestep;
     $params['longitude'] = $this->input['longitude'];
     $params['latitude'] = $this->input['latitude'];
     $params['id'] = $this->obj->insert('delivery_trace', $params);
     $up_info = array('delivery_tracing' => $tracestep);
     if ($tracestep == 4) {
         $express_name = $this->input['express_name'];
         $express_no = $this->input['express_no'];
         $up_info['express_name'] = $express_name;
         $up_info['express_no'] = $express_no;
     }
     $this->obj->update('order', $up_info, " where id={$id} ");
     $this->addItem($params);
     $this->output();
 }