Ejemplo n.º 1
0
 /**
  * 类静态构造实例的唯一入口
  * @params object app object
  * @params object model object
  * @return object b2c_order_delivery的对象
  */
 public static function getInstance($app, $model)
 {
     if (is_object(self::$instance)) {
         return self::$instance;
     }
     self::$instance = new b2c_order_delivery($app, $model);
     return self::$instance;
 }
Ejemplo n.º 2
0
 /**
  * 发货订单处理
  * @params null
  * @return null
  */
 public function dodelivery()
 {
     $obj_order = $this->app->model('orders');
     if (!$order_id) {
         $order_id = $_POST['order_id'];
     } else {
         $_POST['order_id'] = $order_id;
     }
     $sdf = $_POST;
     $sdf['opid'] = $this->user->user_id;
     $sdf['opname'] = $this->user->user_data['account']['login_name'];
     $this->begin();
     $obj_checkorder = kernel::service('b2c_order_apps', array('content_path' => 'b2c_order_checkorder'));
     if (!$obj_checkorder->check_order_delivery($sdf['order_id'], $sdf, $message)) {
         $this->end(false, $message);
     }
     // 处理支付单据.
     $objB2c_delivery = b2c_order_delivery::getInstance($this->app, $this->app->model('delivery'));
     if ($objB2c_delivery->generate($sdf, $this, $message)) {
         if ($order_object = kernel::service('b2c_order_rpc_async')) {
             $order_object->modifyActive($sdf['order_id']);
         }
         $this->end(true, app::get('b2c')->_('发货成功'));
     } else {
         $this->end(false, $message);
     }
 }
Ejemplo n.º 3
0
 /**
  * 发货订单处理
  * @params null
  * @return null
  */
 public function dodelivery()
 {
     $obj_order =& $this->app->model('orders');
     if (!$order_id) {
         $order_id = $_POST['order_id'];
     } else {
         $_POST['order_id'] = $order_id;
     }
     $sdf = $_POST;
     $sdf['opid'] = $this->user->user_id;
     $sdf['opname'] = $this->user->user_data['account']['login_name'];
     $this->begin();
     $obj_checkorder = kernel::service('b2c_order_apps', array('content_path' => 'b2c_order_checkorder'));
     if (!$obj_checkorder->check_order_delivery($sdf['order_id'], $sdf, $message)) {
         $this->end(false, $message);
     }
     // 处理支付单据.
     $objB2c_delivery = b2c_order_delivery::getInstance($this->app, $this->app->model('delivery'));
     if ($objB2c_delivery->generate($sdf, $this, $message)) {
         //ajx crm
         $obj_apiv = kernel::single('b2c_apiv_exchanges_request');
         $req_arr['order_id'] = $sdf['order_id'];
         $obj_apiv->rpc_caller_request($req_arr, 'orderupdatecrm');
         $this->end(true, app::get('b2c')->_('发货成功'));
     } else {
         $this->end(false, $message);
     }
 }
Ejemplo n.º 4
0
 /**
  * 发货订单处理
  * @params null
  * @return null
  */
 public function dodelivery()
 {
     $obj_order =& $this->app->model('orders');
     if (!$order_id) {
         $order_id = $_POST['order_id'];
     } else {
         $_POST['order_id'] = $order_id;
     }
     $sdf = $_POST;
     $sdf['opid'] = $this->user->user_id;
     $sdf['opname'] = $this->user->user_data['account']['login_name'];
     $this->begin();
     $obj_server = kernel::service('svhost_server', array('content_path' => 'svhost_server'));
     $domain = 'test.com';
     #todo
     if (!$obj_server->create($domain, $message)) {
         $this->end(false, $message);
     }
     $obj_checkorder = kernel::service('b2c_order_apps', array('content_path' => 'b2c_order_checkorder'));
     if (!$obj_checkorder->check_order_delivery($sdf['order_id'], $sdf, $message)) {
         $this->end(false, $message);
     }
     // 处理支付单据.
     $objB2c_delivery = b2c_order_delivery::getInstance($this->app, $this->app->model('delivery'));
     if ($objB2c_delivery->generate($sdf, $this, $message)) {
         $this->end(true, __('发货成功'));
     } else {
         $this->end(false, $message);
     }
 }