Commit 256f1d6d authored by liuyuzhen's avatar liuyuzhen

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

parents 49b29af5 e9800167
......@@ -157,8 +157,8 @@ class ArrayConst
);
const defaultDeliveryMan=array(
'id'=>0,
'trueName'=>'配送员a',
'mobile'=>'18650329907',
'trueName'=>'',
'mobile'=>'',
);
const messageOrderButtonsType=array(
0,1,2
......
......@@ -181,6 +181,10 @@ class NameConst {
const versionOne = '1.0.0';
const versionDefault = '1.0';
const bySeller='bySeller';
const bySelf='bySelf';
}
?>
\ No newline at end of file
......@@ -36,10 +36,14 @@ class OrderConst {
const refoundSuccess="已完成";
const sellerRefuse="卖家不同意退款";
const waitVerify="待商家确认";
const sellerAgree="已退款";
const sellerAgree="卖家同意退款";
const sellerAgreeReturn="卖家同意退款,货无需回收";
const alreadyReufndMoney="已退款";
const sellerRefuseGoods="商家已拒绝";
const sellerAgreeGoods="已退款";
// const sellerAgreeGoods="已退款";
const waitSellerRecieve='待收货';
const goodsStateUnRecieve='未收到货';
const goodsStateRecieved='已收货';
//订单列表描述信息
const unpayMessage="10分钟后未付款自动取消订单";
const payCancelMessage="付款后10分钟可取消订单";
......
......@@ -251,6 +251,10 @@ class MessageServiceModel extends \Business\AbstractModel
*/
public function getMemberList($memberId, $selfType, $toId, $otherId, $toType = ApiConst::systemMessageType, $field = '*', $pageIndex = ApiConst::pageIndex, $pageSize = ApiConst::pageSize)
{
if($memberId==$toId){
$toType=ApiConst::storeMessageType;
$selfType=ApiConst::memberMessageType;
}
$messageHistory = \DAO\MessageHistoryModel::getInstance();
$self = $this->getUserByMemberIdAndSelfType($memberId, $selfType);
if (empty($toId)) {
......@@ -352,6 +356,10 @@ class MessageServiceModel extends \Business\AbstractModel
public function update($fromId, $fromType, $toId, $toType)
{
if($fromId==$toId){
$fromType=ApiConst::memberMessageType;
$toType=ApiConst::storeMessageType;
}
$messageHistoryDao = \DAO\MessageHistoryModel::getInstance();
$messageOneDao = \DAO\MessageOneModel::getInstance();
$messageOneDao->setDb(DbNameConst::masterDBConnectName);
......@@ -359,8 +367,8 @@ class MessageServiceModel extends \Business\AbstractModel
$isSuccess = $messageHistoryDao->updateByFromIdAndSelfTypeAndToIdAndToType($fromId, $fromType, $toId, $toType);
$memberDb0Redis=\Redis\Db0\MemberRedisModel::getInstance();
if($isSuccess){
$isSuccess=-1*$isSuccess;
$memberDb0Redis->tableHIncrBy($fromId,'unread_message_count',$isSuccess);
$isSuccess=-1*$isSuccess;
$memberDb0Redis->tableHIncrBy($fromId,'unread_message_count',$isSuccess);
}
return $isSuccess;
......
......@@ -292,9 +292,17 @@ 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']:'';
......
......@@ -443,7 +443,7 @@ class RefundServiceModel extends \Business\AbstractModel
$orderCommons = $orderCommonDao->getAllByOrderIds($orderIds, $orderCommonDao->orderCommonField);
$orderCommons=$orderDao->convertOrder($orderCommons,'orderId');
foreach ($refundMerge as &$value) {
$value['stateName'] = $refundReturnDao->getRefundTextStatus($value);
$value['stateName'] = $refundReturnDao->getRefundTextStatus($value,true);
/*$value['blId'] = isset($value['blId']) ? (!is_null($value['blId']) ? $value['blId'] : ApiConst::zero) : ApiConst::zero;
$value['canPlatformIn'] = $refundReturnDao->isPlatformIn($value) ? ApiConst::one : ApiConst::zero;
$value['canSendShippingType'] = $refundReturnDao->checkIsAddReturnShipping($value) ? ApiConst::one : ApiConst::zero;*/
......@@ -942,7 +942,8 @@ class RefundServiceModel extends \Business\AbstractModel
if($info['refundShippingType']==ApiConst::bySeller){
if($info['returnType']==ApiConst::returnTypeMustReturn){
if(!$info['diliverymanId']){
$info['diliveryman']=ArrayConst::defaultDeliveryMan;
$info['diliveryman']=new \stdClass();
// $info['diliveryman']=ArrayConst::defaultDeliveryMan;
}else{
$diliveryMan=$diliveryManDao->findById($info['diliverymanId']);
if(!empty($diliveryMan)){
......
......@@ -388,6 +388,7 @@ class ShopkeeperServiceModel extends \Business\AbstractModel
{
$order = array('gmt_update' => 'desc');
$orderDao=\DAO\Order\OrderModel::getInstance();
$storeId = $this->_getStoreByMemberId($memberId);
if (empty($storeId)) {
ErrorModel::throwException(CodeConfigModel::paramsError);
......@@ -411,13 +412,16 @@ class ShopkeeperServiceModel extends \Business\AbstractModel
$where = 'han_order.store_id=' . $storeId;
if ($orderState == ApiConst::oneHandred || (int)$orderState == ApiConst::oneHandredOne) {
if ($orderState == ApiConst::oneHandred) {
$where .= ' and han_order.shipping_type=' . ApiConst::bySelf;
// $where=$orderDao->getWaitDeliveryCondition();
// $where .= ' and han_order.shipping_type=' . ApiConst::bySelf;
$where=$orderDao->getByselfCondition($storeId);
} else {
$order=array(
'diliveryman_id'=>'asc',
'gmt_update'=>'asc'
);
$where .= ' and han_order.shipping_type=' . ApiConst::bySeller;
// $where .= ' and han_order.shipping_type=' . ApiConst::bySeller;
$where=$orderDao->getWaitDeliveryCondition($storeId);
}
} else {
......@@ -916,8 +920,8 @@ class ShopkeeperServiceModel extends \Business\AbstractModel
$storeId = $memberDao->getInfo($memberId, 'store_id');
$orderDao = \DAO\Order\OrderModel::getInstance(DbNameConst::salveDBConnectName);
$waitReceiveCount = $orderDao->getCountByOrderState($storeId, ApiConst::orderStateWaitConfirm);
$waitDeliveryCount = $orderDao->getCountByShippingTypeAndOrderState($storeId, ApiConst::bySeller, ApiConst::orderStateWaitRecieve);
$waitGetCount = $orderDao->getCountByShippingTypeAndOrderState($storeId, ApiConst::bySelf, ApiConst::orderStateWaitRecieve);
$waitDeliveryCount = $orderDao->getCountByShippingTypeAndOrderState($storeId);
$waitGetCount = $orderDao->getCountByShippingTypeAndOrderState($storeId,NameConst::bySelf);
$orderCount=$waitReceiveCount+$waitDeliveryCount+$waitGetCount;
return array('waitReceiveCount' => $waitReceiveCount, 'waitDeliveryCount' => $waitDeliveryCount, 'waitGetCount' => $waitGetCount,'orderCount'=>$orderCount);
}
......
......@@ -110,6 +110,7 @@ class SalespersonServiceModel extends \Business\AbstractModel
'qrCode'=>$qrCode,
'memberName'=>$storeInfo['store_name'],
'memberAvatarUrl'=>$storeLabel,
'memberAvatarUrlR20'=>$storeModelDAO->getStoreLabelSrc($storeInfo['store_label'],'','',true).'?x-oss-process=image/rounded-corners,r_20',
'goods'=>$goods ? array($goods) : $goods
];
}
......@@ -145,6 +146,7 @@ class SalespersonServiceModel extends \Business\AbstractModel
'qrCode'=>$qrCode,
'memberName'=>$storeInfo['store_name'],
'memberAvatarUrl'=>$storeLabel,
'memberAvatarUrlR20'=>$storeModelDAO->getStoreLabelSrc($storeInfo['store_label'],'','',true).'?x-oss-process=image/rounded-corners,r_20',
'goods'=>$data ? array($data) : $data
];
$hashData[$saleGoods[$id]][$saleGoods[$id].'_'.$memberId] = $qrCode;
......@@ -250,6 +252,7 @@ class SalespersonServiceModel extends \Business\AbstractModel
$info['qrCode'] = $qrcode;
$info['memberName'] = $storeInfo['store_name'];
$info['memberAvatarUrl'] = $storeLabel;
$info['memberAvatarUrlR20'] = $storeModelDAO->getStoreLabelSrc($storeInfo['store_label'],'','',true).'?x-oss-process=image/rounded-corners,r_20';
$info = array_merge($info,$goods);
}else{
\Error\ErrorModel::throwException(\Error\CodeConfigModel::saleActOrGoodsNotExist);
......
......@@ -72,7 +72,11 @@ class MessageHistoryModel extends \DAO\AbstractModel {
}
public function updateByFromIdAndSelfTypeAndToIdAndToType($fromId,$fromType,$toId,$toType){
$where=Common::format(" (((fromId={0} and toId={1} and toType={2} and fromType={3}) and status=0))",$toId,$fromId,$fromType,$toType);
if($fromId!=$toId){
$where=Common::format(" (((fromId={0} and toId={1} and toType={2} and fromType={3}) and status=0))",$toId,$fromId,$fromType,$toType);
}else{
$where=Common::format(" (((fromId={0} and toId={1} and toType={2} and fromType={3}) and status=0))",$toId,$fromId,$toType,$fromType);
}
$data['status']=ApiConst::read;
return $this->updateByWhere($where,$data);
}
......
......@@ -1035,7 +1035,8 @@ class OrderModel extends \DAO\AbstractModel
'buyerId' => 'buyer_id',
'deliveryTime' => 'delivery_time',
'evaluationState'=>'evaluation_state',
'orderNote'=>'order_note'
'orderNote'=>'order_note',
'isReceivePayment'=>'is_receive_payment'
);
}
......@@ -1127,10 +1128,35 @@ class OrderModel extends \DAO\AbstractModel
$count=$this->getCountByWhere($where);
return $count;
}
public function getCountByShippingTypeAndOrderState($storeId,$shippingType,$orderState){
$where['store_id']=$storeId;
$where['shipping_type']=$shippingType;
$where['order_state']=$orderState;
//获得店铺待配送或者待自提订单条件
public function getWaitDeliveryCondition($id,$memberType='seller'){
if($memberType=='seller'){
$where['store_id']=$id;
}else{
$where['member_id']=$id;
}
$where['shipping_type']=ApiConst::bySeller;
$where['order_state']=array('in',array(ApiConst::orderStateWaitSend,ApiConst::orderStateWaitRecieve));
return $where;
}
public function getByselfCondition($id,$memberType='seller'){
if($memberType=='seller'){
$where['store_id']=$id;
}else{
$where['member_id']=$id;
}
$where['shipping_type']=ApiConst::bySelf;
$where['order_state']=ApiConst::orderStateWaitRecieve;
return $where;
}
public function getCountByShippingTypeAndOrderState($storeId,$type=NameConst::bySeller){
if($type==NameConst::bySeller){
$where=$this->getWaitDeliveryCondition($storeId);
}
if($type==NameConst::bySelf){
$where=$this->getByselfCondition($storeId);
}
$count=$this->getCountByWhere($where);
return $count;
}
......
......@@ -163,26 +163,36 @@ class RefundReturnModel extends \DAO\AbstractModel {
return $this->getAll($where,$field);
}
public function getStatusExtent($returnRefund){
public function getStatusExtent($returnRefund,$isSeller=false){
// if($returnRefund['refundState']!=ApiConst::refundCompleted){
if($returnRefund['sellerState']==ApiConst::refundSellerAgree){
if($returnRefund['isSucRefund']==ApiConst::refundSuccess){
return OrderConst::refoundSuccess;
return OrderConst::alreadyReufndMoney;
}
if($returnRefund['refundType']==ApiConst::refundTypeMoney){
return OrderConst::sellerAgree;
}
if($returnRefund['refundType']==ApiConst::refundTypeGoods){
if($returnRefund['isSucRefund']==ApiConst::refundSuccess){
return OrderConst::sellerAgreeGoods;
}else{
return OrderConst::alreadyReufndMoney;
}
if($returnRefund['goodsState']==ApiConst::goodsStateUnRecieve){
return OrderConst::goodsStateUnRecieve;
}
if($returnRefund['goodsState']==ApiConst::goodsStateRecieved){
return OrderConst::goodsStateRecieved;
}
if($returnRefund['returnType']==ApiConst::returnTypeNotReturn){
return OrderConst::sellerAgreeReturn;
}
if($returnRefund['returnType']==ApiConst::returnTypeMustReturn){
return OrderConst::waitSellerRecieve;
}
}
}
if($returnRefund['sellerState']==ApiConst::refundSellerRefuse){
if($returnRefund['isSucRefund']==ApiConst::refundSuccess){
return OrderConst::refoundSuccess;
return OrderConst::alreadyReufndMoney;
}
if($returnRefund['platformState']==ApiConst::platAgree){
return OrderConst::platFormAgree;
......@@ -204,15 +214,15 @@ class RefundReturnModel extends \DAO\AbstractModel {
// }else{
// return OrderConst::refoundSuccess;
// }
return '';
}
public function getRefundTextStatus($refundReturn){
public function getRefundTextStatus($refundReturn,$isSeller=false){
$refundText='';
switch($refundReturn['sellerState']){
case ApiConst::refundSellerVerify:$refundText=OrderConst::waitVerify;break;
case ApiConst::refundSellerAgree:$refundText=$this->getStatusExtent($refundReturn);break;
case ApiConst::refundSellerRefuse:$refundText=$this->getStatusExtent($refundReturn);break;
default: $refundText=$this->getStatusExtent($refundReturn,$isSeller);break;
}
return $refundText;
......
This diff is collapsed.
......@@ -95,6 +95,11 @@ config.url.ossHost = "http://qmoss-01.oss-cn-hangzhou.aliyuncs.com"
;推送域名
config.url.pushHost="127.0.0.1:9503";
config.url.indexUrl="/www/web/test_qm_com/application/library/React"
config.url.libary="/www/web/test_qm_com/application/library"
config.url.source="/www/web/test_qm_com/public_html/data/upload/"
;config.url.source="E:/WAMP/www/www.qm.com/data/upload/"
; 文件目录
;店铺图片报错目录
......
......@@ -107,7 +107,10 @@ $serv->on('Message', function($server, $frame) use($conf){
$sendMessage['toType']= $rev_data['toType'];
if(!empty($sendFd)){
echo '发送fd:'.$sendFd;
$server->push($sendFd, responseJson(1,"fromMsg","success", $sendMessage));
if($sendFd!=$frame->fd){
$server->push($sendFd, responseJson(1,"fromMsg","success", $sendMessage));
}
}
echo 'afterSendFd:'.$sendFd;
}
......
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