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
const orderStateClose = -1;//关闭定单
const receivePayment = 1;//商家收到货款了
const noreceivePayment = 0;//商家未收到货款
const returnWaitReceive=2;//退货待收货
const deleteStateOne = 1;
const deleteStateZero = 0;
const deleteStateTwo = 2;
......
......@@ -231,7 +231,7 @@ class OrderServiceModel extends \Business\AbstractModel
*/
public function getOrderDetail($orderId)
{
// error_reporting(E_ALL);
error_reporting(E_ALL);
$orderDao = \DAO\Order\OrderModel::getInstance(DbNameConst::salveDBConnectName);
$addressDao = \DAO\AddressModel::getInstance(DbNameConst::salveDBConnectName);
$orderCommonDao = \DAO\Order\OrderCommonModel::getInstance(DbNameConst::salveDBConnectName);
......@@ -268,7 +268,7 @@ class OrderServiceModel extends \Business\AbstractModel
//商店相关信息
// $this->store=$storeDao->get($this->order['storeId']);
// $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;
//配送员信息
$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
$returnData['diliverymanId'] = ApiConst::zero;
$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['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']);
$returnData['reciverInfo'] = $this->address;
$returnData['reciverInfo']['mobPhone']=!empty($returnData['reciverInfo']['mobPhone'])?$returnData['reciverInfo']['mobPhone']:'';
......
......@@ -409,36 +409,28 @@ class RefundServiceModel extends \Business\AbstractModel
$addressDao = \DAO\Order\DAddressModel::getInstance(DbNameConst::salveDBConnectName);
$orderCommonDao = \DAO\Order\OrderCommonModel::getInstance();
$where['store_id'] = $storeId;
$where['order_lock'] = 2;
// $where['store_id'] = $storeId;
// $where['order_lock'] = 2;
$order = array('add_time' => 'desc');
switch($type) {
case 1:
$where['refund_state'] = 1;
break;
case 2:
$where['refund_state'] = 2;
$where['refund_type'] = 2;
$order= array('receive_time'=> 'asc');
break;
if($type==ApiConst::refundSellerVerify){
$where=$refundReturnDao->getProccessOrderBySeller($storeId);
}
if($type==ApiConst::refundSellerAgree){
$where=$refundReturnDao->getReturnWaitReceive($storeId);
$order= array('receive_time'=> 'asc');
}
//获得售后列表
$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');
//获得售后商品列表getOrderGoodsByRecIds
if (!empty($orderGoodsId)) {
$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');
$orderIds= array_column($refundMerge, 'orderId');
$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');
$orderCommons = $orderCommonDao->getAllByOrderIds($orderIds, $orderCommonDao->orderCommonField);
$orderCommons=$orderDao->convertOrder($orderCommons,'orderId');
......
......@@ -931,8 +931,8 @@ class ShopkeeperServiceModel extends \Business\AbstractModel
$storeId = $memberDao->getInfo($memberId, 'store_id');
$refundReturnDao = \DAO\Order\RefundReturnModel::getInstance(DbNameConst::salveDBConnectName);
//待处理
$waitRefundProccessCount = $refundReturnDao->getCountByRefundState($storeId, ApiConst::orderStateWaitConfirm);
$waitRefundReceiveCount = $refundReturnDao->getCountByRefundType($storeId, ApiConst::refundTypeGoods);
$waitRefundProccessCount = $refundReturnDao->getCountByRefundState($storeId);
$waitRefundReceiveCount = $refundReturnDao->getCountByRefundType($storeId);
$refundCount=$waitRefundProccessCount+$waitRefundReceiveCount;
return array('waitRefundProccessCount' => $waitRefundProccessCount, 'waitRefundReceiveCount' => $waitRefundReceiveCount, 'refundCount' =>$refundCount);
}
......
......@@ -558,21 +558,32 @@ class RefundReturnModel extends \DAO\AbstractModel {
* @param $orderState
* @return mixed 待处理
*/
public function getCountByRefundState($storeId,$refundState){
$where['store_id']=$storeId;
$where['refund_state']=$refundState;
public function getCountByRefundState($storeId){
$where=$this->getProccessOrderBySeller($storeId);
$count=$this->getCountByWhere($where);
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 $orderState
* @return mixed 待收货
*/
public function getCountByRefundType($storeId,$refundType){
$where['store_id']=$storeId;
$where['refund_type']=$refundType;
$where['goods_state']=array('neq',ApiConst::four);
public function getCountByRefundType($storeId){
$where=$this->getReturnWaitReceive($storeId);
$count=$this->getCountByWhere($where);
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