public function submit_order()
 {
     addLog("Santi/submit_order", $_GET, $_POST, '[调试]三体订单提交地址');
     $channelOrderNo = $this->_post('channelOrderNo', '');
     $prodPayType = $this->_post('prodPayType', '');
     $prodValue = $this->_post('prodValue', '');
     $prodId = $this->_post('prodId', '');
     $uid = $this->_post('uid', '', '用户ID缺失');
     if (empty($uid) || $uid < 0) {
         $this->apiReturnErr('用户ID非法');
     }
     $result = apiCall(UserApi::GET_INFO, array($uid));
     if (!$result['status']) {
         $this->apiReturnErr($result['info']);
     }
     if (is_null($result['info'])) {
         $this->apiReturnErr('获取用户信息失败,无法发送流量包!');
     }
     $mobile = $result['info']['mobile'];
     $mobile = trim($mobile);
     if (empty($mobile) || strlen($mobile) != 11) {
         $this->apiReturnErr($mobile . '手机号不合法!');
     }
     $santi = new SFOrder();
     if (empty($prodId)) {
         $this->error('缺少产品ID');
     }
     $channelOrderNo = date('YmdHis', time()) . rand(100, 999);
     if (empty($prodValue)) {
         $result = $santi->createOrder($prodId, $mobile, $prodPayType, $channelOrderNo);
     } else {
         $result = $santi->createOrderWithProdValue($prodValue, $mobile, $prodPayType, $channelOrderNo);
     }
     $orderNo = '';
     $orderStatus = '';
     $createOrderTime = '';
     $err_msg = '';
     if (!$result['status']) {
         $err_msg = $result['info'];
     }
     $info = $result['info'];
     if (empty($err_msg) && isset($info['resultCode'])) {
         $resultCode = $info['resultCode'];
         $resultReason = $info['resultReason'];
         if ($resultCode == '1000') {
             $orderNo = $info['orderNo'];
             $orderStatus = $info['orderStatus'];
             $createOrderTime = $info['createOrderTime'];
         } else {
             $err_msg = $resultReason;
         }
     }
     if (!empty($err_msg)) {
         $this->apiReturnErr($err_msg);
     }
     $update_time = strtotime($createOrderTime);
     $entity = array('create_time' => time(), 'update_time' => $update_time, 'order_status' => $orderStatus, 'order_no' => $orderNo, 'mobile' => $mobile, 'prod_id' => $prodId, 'prod_pay_type' => $prodPayType, 'channel_order_no' => $channelOrderNo);
     $result = apiCall(SantiOrderApi::ADD, array($entity));
     if (!$result['status']) {
         $this->apiReturnErr($result['info']);
     }
     $this->submit($orderNo);
 }
 public function create($mobile, $flow, $prodPayType = 0)
 {
     //推荐人 10m 联通是20m 使用推荐码成功注册 200m   未使用推荐码自己注册送100m
     $order = new SFOrder();
     $channelOrderNo = $mobile . $flow . time() . rand(1000, 3000);
     $result = $order->createOrderWithProdValue($flow, $mobile, $prodPayType, $channelOrderNo);
     if ($result['status']) {
         $info = $result['info'];
         if ($info['resultCode'] == 1000) {
             $entity = array('orderNo' => $info['orderNo'], 'channelOrderNo' => $channelOrderNo, 'prodPayType' => $prodPayType);
             //0 订单未提交 1 准备充值 2 订单取消3充值中 4充值成功 5充值失败
             return array('status' => true, 'info' => $entity);
         } else {
             return array('status' => false, 'info' => $info['resultReason']);
         }
     } else {
         return $result;
     }
 }