@@ -36,7 +36,7 @@ class RefundServiceModel extends \Business\AbstractModel
...
@@ -36,7 +36,7 @@ class RefundServiceModel extends \Business\AbstractModel
//获得退款详情字段
//获得退款详情字段
private$refundReturnField='refund_id as refundId,order_id as orderId,order_sn as orderSn,refund_sn as refundSn,store_id as storeId,store_name as storeName,seller_state as sellerState,goods_id as goodsId,order_goods_id as orderGoodsId,goods_name as goodsName,goods_num as goodsNum,refund_amount as refundAmount,goods_image as goodsImage,refund_type as refundType,refund_state as refundState,return_type as returnType,add_time as addTime,seller_time as sellerTime,admin_time as adminTime,reason_info as reasonInfo,pic_info as picInfo,buyer_message as buyerMessage,seller_message as sellerMessage,admin_message adminMessage,express_id as expressId,invoice_no as invoiceNo,ship_time as shipTime,delay_time as delayTime,receive_time as receiveTime,shipping_over as shippingOver,shipping_sign as shippingSign,shipping_html as shippingHtml,is_suc_refund as isSucRefund,refund_shipping_type as refundShippingType,address_id as addressId,diliveryman_id as diliverymanId,is_platform_in as isPlatformIn,platform_in_reason as platformInReason,platform_state as platformState,seller_state as sellerState,return_type as returnType,refund_shipping_type as refundShippingType,buyer_refund_amount as buyerRefundAmount,reason_id as reasonId,receive_message as receiveMessage,goods_state as goodsState';
private$refundReturnField='refund_id as refundId,order_id as orderId,order_sn as orderSn,refund_sn as refundSn,store_id as storeId,store_name as storeName,seller_state as sellerState,goods_id as goodsId,order_goods_id as orderGoodsId,goods_name as goodsName,goods_num as goodsNum,refund_amount as refundAmount,goods_image as goodsImage,refund_type as refundType,refund_state as refundState,return_type as returnType,add_time as addTime,seller_time as sellerTime,admin_time as adminTime,reason_info as reasonInfo,pic_info as picInfo,buyer_message as buyerMessage,seller_message as sellerMessage,admin_message adminMessage,express_id as expressId,invoice_no as invoiceNo,ship_time as shipTime,delay_time as delayTime,receive_time as receiveTime,shipping_over as shippingOver,shipping_sign as shippingSign,shipping_html as shippingHtml,is_suc_refund as isSucRefund,refund_shipping_type as refundShippingType,address_id as addressId,diliveryman_id as diliverymanId,is_platform_in as isPlatformIn,platform_in_reason as platformInReason,platform_state as platformState,seller_state as sellerState,return_type as returnType,refund_shipping_type as refundShippingType,buyer_refund_amount as buyerRefundAmount,reason_id as reasonId,receive_message as receiveMessage,goods_state as goodsState';
private$storeRefundReturnField='refund_id as refundId,order_id as orderId,order_sn as orderSn,refund_sn as refundSn,store_id as storeId,store_name as storeName,seller_state as sellerState,goods_id as goodsId,order_goods_id as orderGoodsId,goods_name as goodsName,goods_num as goodsNum,refund_amount as refundAmount,buyer_refund_amount as buyerRefundAmount,goods_image as goodsImage,refund_type as refundType,refund_state as refundState,return_type as returnType,add_time as addTime,seller_time as sellerTime,admin_time as adminTime,reason_id as reasonId,reason_info as reasonInfo,pic_info as picInfo,buyer_message as buyerMessage,seller_message as sellerMessage,admin_message adminMessage,express_id as expressId,invoice_no as invoiceNo,ship_time as shipTime,delay_time as delayTime,receive_time as receiveTime,receive_message as receiveMessage,shipping_over as shippingOver,shipping_sign as shippingSign,shipping_html as shippingHtml,is_suc_refund as isSucRefund,refund_shipping_type as refundShippingType,address_id as addressId,diliveryman_id as diliverymanId,is_platform_in as isPlatformIn,platform_in_reason as platformInReason,platform_state as platformState,return_type as returnType,refund_shipping_type as refundShippingType,goods_state as goodsState';
private$storeRefundReturnField='refund_id as refundId,order_id as orderId,order_sn as orderSn,refund_sn as refundSn,store_id as storeId,store_name as storeName,seller_state as sellerState,goods_id as goodsId,order_goods_id as orderGoodsId,goods_name as goodsName,goods_num as goodsNum,refund_amount as refundAmount,buyer_refund_amount as buyerRefundAmount,goods_image as goodsImage,refund_type as refundType,refund_state as refundState,return_type as returnType,add_time as addTime,seller_time as sellerTime,admin_time as adminTime,reason_id as reasonId,reason_info as reasonInfo,pic_info as picInfo,buyer_message as buyerMessage,seller_message as sellerMessage,admin_message adminMessage,express_id as expressId,invoice_no as invoiceNo,ship_time as shipTime,delay_time as delayTime,receive_time as receiveTime,receive_message as receiveMessage,shipping_over as shippingOver,shipping_sign as shippingSign,shipping_html as shippingHtml,is_suc_refund as isSucRefund,refund_shipping_type as refundShippingType,address_id as addressId,diliveryman_id as diliverymanId,is_platform_in as isPlatformIn,platform_in_reason as platformInReason,platform_state as platformState,return_type as returnType,refund_shipping_type as refundShippingType,goods_state as goodsState,buyer_name as buyerName';
private$order;
private$order;
...
@@ -450,7 +450,7 @@ class RefundServiceModel extends \Business\AbstractModel
...
@@ -450,7 +450,7 @@ class RefundServiceModel extends \Business\AbstractModel
@@ -45,7 +45,7 @@ class OrderModel extends \DAO\AbstractModel
...
@@ -45,7 +45,7 @@ class OrderModel extends \DAO\AbstractModel
publicfunctiongetOrderDetailField()
publicfunctiongetOrderDetailField()
{
{
return'order_id as orderId,coupon_id as couponId,refund_amount as refundAmount,order_sn as orderSn,pay_sn as paySn,store_name as storeName,add_time as addTime,store_id as storeId,goods_amount as goodsAmount,shipping_fee as shippingFee,order_amount as orderAmount,shipping_type as shippingType,payment_type as paymentType,order_state as orderState,shipping_fee as shippingFee,refund_state as refundState,order_type as orderType,is_receive_payment as isReceivePayment,payment_time as paymentTime,finnshed_time as finnshedTime,need_shipping_fee as needShippingFee,payment_code as paymentCode,buyer_id as buyerId,buyer_name as buyerName,refund_condition as refundCondition,delay_time as delayTime,gmt_update as gmtUpdate,diliveryman_id as diliverymanId,shipping_arrival_time as shippingArrivalTime,delivery_time as deliveryTime,order_note as orderNote';
return'order_id as orderId,coupon_id as couponId,refund_amount as refundAmount,order_sn as orderSn,pay_sn as paySn,store_name as storeName,add_time as addTime,store_id as storeId,goods_amount as goodsAmount,shipping_fee as shippingFee,order_amount as orderAmount,shipping_type as shippingType,payment_type as paymentType,order_state as orderState,shipping_fee as shippingFee,refund_state as refundState,order_type as orderType,is_receive_payment as isReceivePayment,payment_time as paymentTime,finnshed_time as finnshedTime,need_shipping_fee as needShippingFee,payment_code as paymentCode,buyer_id as buyerId,buyer_name as buyerName,refund_condition as refundCondition,delay_time as delayTime,gmt_update as gmtUpdate,diliveryman_id as diliverymanId,shipping_arrival_time as shippingArrivalTime,delivery_time as deliveryTime,order_note as orderNote,send_time as sendTime';
}
}
publicfunctiongetOrderShippingField()
publicfunctiongetOrderShippingField()
...
@@ -419,10 +419,11 @@ class OrderModel extends \DAO\AbstractModel
...
@@ -419,10 +419,11 @@ class OrderModel extends \DAO\AbstractModel
@@ -438,6 +439,62 @@ class OrderModel extends \DAO\AbstractModel
...
@@ -438,6 +439,62 @@ class OrderModel extends \DAO\AbstractModel
$res=$this->db->from($this->_tableName)->where($where)->select(" buyer_id as buyerId,store_id as storeId,(SUM(order_amount)) AS orderTotal")->group('buyer_id')->group('store_id')->fetchAll();
$res=$this->db->from($this->_tableName)->where($where)->select(" buyer_id as buyerId,store_id as storeId,(SUM(order_amount)) AS orderTotal")->group('buyer_id')->group('store_id')->fetchAll();
$res=$this->db->from($this->_tableName)->where($where)->select(" buyer_id as buyerId,store_id as storeId,(SUM(order_amount)) AS orderTotal")->fetchOne();
$res=$this->db->from($this->_tableName)->where($where)->select(" buyer_id as buyerId,store_id as storeId,(order_amount-refund_amount) as orderTotalOnline")->fetchOne();
$selectSql=Common::format("select {0} from {1} where store_id={2} and buyer_id={3} and is_refund<>{4} and order_id in (select order_id from han_order where store_id={2} and buyer_id={3} and order_state not in({5}) ) ",$this->sumGoodsNum,$this->_tableName,$storeId,$memberId,ApiConst::refundSuccess,"0,-1");
}else{
$selectSql=Common::format("select {0} from {1} where store_id={2} and is_refund<>{4} and order_id in (select order_id from han_order where store_id={2} and order_state not in({5}) ) ",$this->sumGoodsNum,$this->_tableName,$storeId,$memberId,ApiConst::refundSuccess,"0,-1");
@@ -68,6 +68,20 @@ class RefundReturnModel extends \DAO\AbstractModel
...
@@ -68,6 +68,20 @@ class RefundReturnModel extends \DAO\AbstractModel
}
}
// public function getRefundSuccessMoneyByStoreIdAndMemberId($storeId, $buyerId)
// {
// $this->setDb($this->dbName);
// if (is_array($storeId)) {
// $storeId = implode(',', $storeId);
// }
// if (is_array($buyerId)) {
// $buyerId = implode(',', $buyerId);
// }
// $where = \Our\Common::format(" store_id in({0}) and buyer_id in({1}) and is_suc_refund={2}", $storeId, $buyerId, ApiConst::refundSuccess);
// $res = $this->db->from($this->_tableName)->where($where)->select(" buyer_id as buyerId,store_id as storeId,(SUM(refund_amount)) AS refundTotal")->group('buyer_id')->group('store_id')->fetchAll();
@@ -78,7 +92,7 @@ class RefundReturnModel extends \DAO\AbstractModel
...
@@ -78,7 +92,7 @@ class RefundReturnModel extends \DAO\AbstractModel
$buyerId=implode(',',$buyerId);
$buyerId=implode(',',$buyerId);
}
}
$where=\Our\Common::format(" store_id in({0}) and buyer_id in({1}) and is_suc_refund={2}",$storeId,$buyerId,ApiConst::refundSuccess);
$where=\Our\Common::format(" store_id in({0}) and buyer_id in({1}) and is_suc_refund={2}",$storeId,$buyerId,ApiConst::refundSuccess);
$res=$this->db->from($this->_tableName)->where($where)->select(" buyer_id as buyerId,store_id as storeId,(SUM(refund_amount)) AS refundTotal")->group('buyer_id')->group('store_id')->fetchAll();
$res=$this->db->from($this->_tableName)->where($where)->select(" buyer_id as buyerId,store_id as storeId,(SUM(refund_amount)) AS refundTotal,")->group('buyer_id')->group('store_id')->fetchAll();
return!empty($res)?$res:[];
return!empty($res)?$res:[];
}
}
...
@@ -662,7 +676,7 @@ class RefundReturnModel extends \DAO\AbstractModel
...
@@ -662,7 +676,7 @@ class RefundReturnModel extends \DAO\AbstractModel
$res=$this->db->from($this->_tableName)->where($where)->select(" buyer_id as buyerId,store_id as storeId,(SUM(refund_amount)) AS refundAmount")->fetchOne();
public$sumField='sum(order_total) as orderTotal,sum(order_goods_count) as orderGoodsCount';
public$sumField='sum(order_total) as orderTotal,sum(order_goods_count) as orderGoodsCount';
public$field="fav_type as favType,member_id as memberId,member_mobile as memberMobile,is_backlist as isBacklist,fav_time as favTime,member_avatar as memberAvatar,member_name as memberName,order_total as orderTotal,order_goods_count as orderGoodsCount";
public$field="fav_type as favType,member_id as memberId,member_mobile as memberMobile,is_backlist as isBacklist,fav_time as favTime,member_avatar as memberAvatar,member_name as memberName,order_total as orderTotal,order_goods_count as orderGoodsCount";
/**
/**
* 主键
* 主键
*
*
...
@@ -30,67 +33,86 @@ class MemberFavoritesStoreStoreMemberStatisticsModel extends \DAO\AbstractModel
...
@@ -30,67 +33,86 @@ class MemberFavoritesStoreStoreMemberStatisticsModel extends \DAO\AbstractModel