示例#1
0
 /**
  * 删除一个分渠道
  * @author czq
  */
 public function view_delete()
 {
     if ($_GET['id']) {
         $id = intval($_GET['id']);
         $data = array('is_delete' => 1);
         WhChannelPartitionModel::update($data, $id);
     }
     header("location:index.php?mod=whChannelPartition&act=index");
 }
 /**
  * 获取全部已用的桶号
  * @return array $partitions:
  * @author czq
  */
 public static function getUsedPartitions()
 {
     $partionList = WhChannelPartitionModel::select(' is_delete = 0 ORDER BY partition ASC');
     $partitions = array();
     if ($partionList) {
         foreach ($partionList as $list) {
             $partitions = $list['partition'];
         }
     }
     return $partitions;
 }
示例#3
0
 /**
  * 分渠道操作
  * @author czq
  */
 public function act_checkChannel()
 {
     if (!$_SESSION['userId']) {
         $result = array('status' => 0, 'msg' => '请先登录系统');
         echo json_encode($result);
         exit;
     }
     $shipOrderId = trim($_REQUEST['shipOrderId']);
     $shipOrder = WhShippingOrderModel::find($shipOrderId);
     if (empty($shipOrder)) {
         $result = array('status' => 'A00', 'msg' => '发货单信息不存在');
         echo json_encode($result);
         exit;
     }
     if ($shipOrder['orderStatus'] != PKS_WDISTRICT) {
         $result = array('status' => 'A00', 'msg' => '发货单非待分区状态,不能分区');
         echo json_encode($result);
         exit;
     }
     if (empty($shipOrder['channelId'])) {
         $result = array('status' => 'A00', 'msg' => '发货单在申请运输方式中,请稍后分区');
         echo json_encode($result);
         exit;
     }
     $partition = WhChannelPartitionModel::getChannelPartition($shipOrder['channelId']);
     if ($partition) {
         $vo = WhOrderChannelpartRecordsModel::find("shipOrderId='" . $shipOrderId . "'");
         $partition = $partition[0];
         $partition['code'] = 'A' . substr('0' . $partition['partition'], -2);
         if (!$vo) {
             $data = array('shipOrderId' => $shipOrderId, 'partitionId' => $partition['id'], 'scanUserId' => $_SESSION['userId'], 'scanTime' => time(), 'is_delete' => 0);
             WhOrderChannelpartRecordsModel::insert($data);
             $result = array('status' => $partition['code'], 'partition' => $partition['partition'], 'msg' => $partition['title']);
         } else {
             $result = array('status' => $partition['code'], 'partition' => $partition['partition'], 'msg' => '包裹已分拣,渠道为: ' . $partition['title']);
         }
     } else {
         $result = array('status' => 'A00', 'partition' => '', 'msg' => '当前运输方式未建立分渠道,请联系销售人员');
     }
     echo json_encode($result);
     exit;
 }