Commit 4c1729a5 authored by liuyuzhen's avatar liuyuzhen

Merge branch 'master_dev' of git.shenbd.com:qm-develop/shenbd into lyz_version1

parents f58b3ab1 0ee06732
...@@ -155,6 +155,7 @@ class ApiConst ...@@ -155,6 +155,7 @@ class ApiConst
const orderStateClose = -1;//关闭定单 const orderStateClose = -1;//关闭定单
const receivePayment = 1;//商家收到货款了 const receivePayment = 1;//商家收到货款了
const noreceivePayment = 0;//商家未收到货款 const noreceivePayment = 0;//商家未收到货款
const returnWaitReceive=2;//退货待收货
const deleteStateOne = 1; const deleteStateOne = 1;
const deleteStateZero = 0; const deleteStateZero = 0;
const deleteStateTwo = 2; const deleteStateTwo = 2;
......
...@@ -231,7 +231,7 @@ class OrderServiceModel extends \Business\AbstractModel ...@@ -231,7 +231,7 @@ class OrderServiceModel extends \Business\AbstractModel
*/ */
public function getOrderDetail($orderId) public function getOrderDetail($orderId)
{ {
// error_reporting(E_ALL); error_reporting(E_ALL);
$orderDao = \DAO\Order\OrderModel::getInstance(DbNameConst::salveDBConnectName); $orderDao = \DAO\Order\OrderModel::getInstance(DbNameConst::salveDBConnectName);
$addressDao = \DAO\AddressModel::getInstance(DbNameConst::salveDBConnectName); $addressDao = \DAO\AddressModel::getInstance(DbNameConst::salveDBConnectName);
$orderCommonDao = \DAO\Order\OrderCommonModel::getInstance(DbNameConst::salveDBConnectName); $orderCommonDao = \DAO\Order\OrderCommonModel::getInstance(DbNameConst::salveDBConnectName);
...@@ -268,7 +268,7 @@ class OrderServiceModel extends \Business\AbstractModel ...@@ -268,7 +268,7 @@ class OrderServiceModel extends \Business\AbstractModel
//商店相关信息 //商店相关信息
// $this->store=$storeDao->get($this->order['storeId']); // $this->store=$storeDao->get($this->order['storeId']);
// $this->store=Common::convertUnderline($this->store[0]); // $this->store=Common::convertUnderline($this->store[0]);
$this->store = \Our\RedisHelper::cachedFunction(\Redis\Db5\OrderRedisModel::getInstance(), array(&$storeDao, 'getInfoById'), array($this->order['storeId'], $storeDao->detailField), \Our\ApiConst::sevenDaySecond,array($this->order['storeId'])); $this->store = \Our\RedisHelper::cachedFunction(\Redis\Db6\StoreRedisModel::getInstance(), array(&$storeDao, 'getInfoById'), array($this->order['storeId'], $storeDao->detailField), \Our\ApiConst::sevenDaySecond,array($this->order['storeId']));
$returnData = $this->order; $returnData = $this->order;
//配送员信息 //配送员信息
$this->diliveryman = \Our\RedisHelper::cachedFunction(\Redis\Db5\OrderRedisModel::getInstance(), array(&$diliverymanDao, 'findById'), array($returnData['diliverymanId']), \Our\ApiConst::oneDaySecond); $this->diliveryman = \Our\RedisHelper::cachedFunction(\Redis\Db5\OrderRedisModel::getInstance(), array(&$diliverymanDao, 'findById'), array($returnData['diliverymanId']), \Our\ApiConst::oneDaySecond);
...@@ -292,9 +292,18 @@ class OrderServiceModel extends \Business\AbstractModel ...@@ -292,9 +292,18 @@ class OrderServiceModel extends \Business\AbstractModel
$returnData['diliverymanId'] = ApiConst::zero; $returnData['diliverymanId'] = ApiConst::zero;
$returnData['deliveryman'] = new \stdClass(); $returnData['deliveryman'] = new \stdClass();
} }
if(!in_array($this->order['paymentType'],ArrayConst::payTypeOnlines)){
$returnData['offlinePayway']=$storeDao->convertOfflinePayway($this->store['offlinePayway']);
}else{
$returnData['offlinePayway']=new \stdClass();
}
if(CURRENTVERSION!=NameConst::versionOne){
$returnData['offlinePayway']='';
}
$returnData['storeMemberId']=$this->store['memberId']; $returnData['storeMemberId']=$this->store['memberId'];
$returnData['totalGoodsNum'] = $orderGoodsDao->getGoodsCount($this->orderGoodsList); $returnData['totalGoodsNum'] = $orderGoodsDao->getGoodsCount($this->orderGoodsList);
$returnData['offlinePayway'] = $this->store['offlinePayway'] ? $this->store['offlinePayway'] : ''; // $returnData['offlinePayway'] =$this->store['offlinePayway'] ? $this->store['offlinePayway'] : '';
$this->address['address']=$orderCommonDao->convertReceiveAddress($this->address['address']); $this->address['address']=$orderCommonDao->convertReceiveAddress($this->address['address']);
$returnData['reciverInfo'] = $this->address; $returnData['reciverInfo'] = $this->address;
$returnData['reciverInfo']['mobPhone']=!empty($returnData['reciverInfo']['mobPhone'])?$returnData['reciverInfo']['mobPhone']:''; $returnData['reciverInfo']['mobPhone']=!empty($returnData['reciverInfo']['mobPhone'])?$returnData['reciverInfo']['mobPhone']:'';
......
...@@ -409,36 +409,28 @@ class RefundServiceModel extends \Business\AbstractModel ...@@ -409,36 +409,28 @@ class RefundServiceModel extends \Business\AbstractModel
$addressDao = \DAO\Order\DAddressModel::getInstance(DbNameConst::salveDBConnectName); $addressDao = \DAO\Order\DAddressModel::getInstance(DbNameConst::salveDBConnectName);
$orderCommonDao = \DAO\Order\OrderCommonModel::getInstance(); $orderCommonDao = \DAO\Order\OrderCommonModel::getInstance();
$where['store_id'] = $storeId; // $where['store_id'] = $storeId;
$where['order_lock'] = 2; // $where['order_lock'] = 2;
$order = array('add_time' => 'desc'); $order = array('add_time' => 'desc');
switch($type) { if($type==ApiConst::refundSellerVerify){
case 1: $where=$refundReturnDao->getProccessOrderBySeller($storeId);
$where['refund_state'] = 1; }
break; if($type==ApiConst::refundSellerAgree){
case 2: $where=$refundReturnDao->getReturnWaitReceive($storeId);
$where['refund_state'] = 2; $order= array('receive_time'=> 'asc');
$where['refund_type'] = 2;
$order= array('receive_time'=> 'asc');
break;
} }
//获得售后列表 //获得售后列表
$refundReturns = \Our\RedisHelper::cachedFunction(\Redis\Db5\OrderRedisModel::getInstance(), array(&$refundReturnDao, 'getList'), array($where, $this->storeRefundReturnField, $pageIndex, $pageSize, $order), \Our\ApiConst::oneDaySecond, array($storeId)); $refundReturns = \Our\RedisHelper::cachedFunction(\Redis\Db5\OrderRedisModel::getInstance(), array(&$refundReturnDao, 'getList'), array($where, $this->storeRefundReturnField, $pageIndex, $pageSize,$order), \Our\ApiConst::oneDaySecond, array($storeId));
$orderGoodsId = array_column($refundReturns['list'], 'orderGoodsId'); $orderGoodsId = array_column($refundReturns['list'], 'orderGoodsId');
//获得售后商品列表getOrderGoodsByRecIds //获得售后商品列表getOrderGoodsByRecIds
if (!empty($orderGoodsId)) { if (!empty($orderGoodsId)) {
$orderGoods = \Our\RedisHelper::cachedFunction(\Redis\Db5\OrderRedisModel::getInstance(), array(&$orderGoodsDao, 'getOrderGoodsByRecIds'), array($orderGoodsId, $this->refundOrderGoodsField), \Our\ApiConst::oneDaySecond, array($storeId)); $orderGoods = \Our\RedisHelper::cachedFunction(\Redis\Db5\OrderRedisModel::getInstance(), array(&$orderGoodsDao, 'getOrderGoodsByRecIds'), array($orderGoodsId, $this->refundOrderGoodsField), \Our\ApiConst::oneDaySecond, array($storeId));
$refundMerge = Common::intergrateOneToOne($refundReturns['list'], $orderGoods, 'orderGoodsId', 'recId'); $refundMerge = Common::intergrateOneToOne($refundReturns['list'], $orderGoods, 'orderGoodsId', 'recId');
$orderIds= array_column($refundMerge, 'orderId'); $orderIds= array_column($refundMerge, 'orderId');
$orderWhere['order_id']=array('in',$orderIds); $orderWhere['order_id']=array('in',$orderIds);
$orders = \Our\RedisHelper::cachedFunction(\Redis\Db5\OrderRedisModel::getInstance(), array(&$orderDao, 'getList'), array($orderWhere, "order_id as orderId,goods_amount as goodsAmount,order_amount as orderAmount,shipping_fee as shippingFee,order_sn as orderSn,payment_type as paymentType", ApiConst::zero, $pageSize, $order, \Our\ApiConst::oneDaySecond, array($storeId))); $orders = \Our\RedisHelper::cachedFunction(\Redis\Db5\OrderRedisModel::getInstance(), array(&$orderDao, 'getList'), array($orderWhere, $orderDao->getOrderDetailField(), ApiConst::zero, $pageSize), \Our\ApiConst::oneDaySecond, array($storeId));
$orders=$orderDao->convertOrder($orders['list'],'orderId'); $orders=$orderDao->convertOrder($orders['list'],'orderId');
$orderCommons = $orderCommonDao->getAllByOrderIds($orderIds, $orderCommonDao->orderCommonField); $orderCommons = $orderCommonDao->getAllByOrderIds($orderIds, $orderCommonDao->orderCommonField);
$orderCommons=$orderDao->convertOrder($orderCommons,'orderId'); $orderCommons=$orderDao->convertOrder($orderCommons,'orderId');
......
...@@ -931,8 +931,8 @@ class ShopkeeperServiceModel extends \Business\AbstractModel ...@@ -931,8 +931,8 @@ class ShopkeeperServiceModel extends \Business\AbstractModel
$storeId = $memberDao->getInfo($memberId, 'store_id'); $storeId = $memberDao->getInfo($memberId, 'store_id');
$refundReturnDao = \DAO\Order\RefundReturnModel::getInstance(DbNameConst::salveDBConnectName); $refundReturnDao = \DAO\Order\RefundReturnModel::getInstance(DbNameConst::salveDBConnectName);
//待处理 //待处理
$waitRefundProccessCount = $refundReturnDao->getCountByRefundState($storeId, ApiConst::orderStateWaitConfirm); $waitRefundProccessCount = $refundReturnDao->getCountByRefundState($storeId);
$waitRefundReceiveCount = $refundReturnDao->getCountByRefundType($storeId, ApiConst::refundTypeGoods); $waitRefundReceiveCount = $refundReturnDao->getCountByRefundType($storeId);
$refundCount=$waitRefundProccessCount+$waitRefundReceiveCount; $refundCount=$waitRefundProccessCount+$waitRefundReceiveCount;
return array('waitRefundProccessCount' => $waitRefundProccessCount, 'waitRefundReceiveCount' => $waitRefundReceiveCount, 'refundCount' =>$refundCount); return array('waitRefundProccessCount' => $waitRefundProccessCount, 'waitRefundReceiveCount' => $waitRefundReceiveCount, 'refundCount' =>$refundCount);
} }
......
...@@ -558,21 +558,32 @@ class RefundReturnModel extends \DAO\AbstractModel { ...@@ -558,21 +558,32 @@ class RefundReturnModel extends \DAO\AbstractModel {
* @param $orderState * @param $orderState
* @return mixed 待处理 * @return mixed 待处理
*/ */
public function getCountByRefundState($storeId,$refundState){ public function getCountByRefundState($storeId){
$where['store_id']=$storeId; $where=$this->getProccessOrderBySeller($storeId);
$where['refund_state']=$refundState;
$count=$this->getCountByWhere($where); $count=$this->getCountByWhere($where);
return $count; return $count;
} }
//获得售后待处理订单条件
public function getProccessOrderBySeller($id){
$where['store_id']=$id;
$where['refund_state']=ApiConst::refundSellerVerify;
return $where;
}
//获得售后待收货订单条件
public function getReturnWaitReceive($id){
$where['store_id']=$id;
$where['refund_type']=ApiConst::refundTypeGoods;
$where['goods_state']=ApiConst::goodsStateWaitRecieve;
return $where;
}
/** /**
* @param $storeId * @param $storeId
* @param $orderState * @param $orderState
* @return mixed 待收货 * @return mixed 待收货
*/ */
public function getCountByRefundType($storeId,$refundType){ public function getCountByRefundType($storeId){
$where['store_id']=$storeId; $where=$this->getReturnWaitReceive($storeId);
$where['refund_type']=$refundType;
$where['goods_state']=array('neq',ApiConst::four);
$count=$this->getCountByWhere($where); $count=$this->getCountByWhere($where);
return $count; return $count;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment