Commit faec74d7 authored by liuyuzhen's avatar liuyuzhen

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

parents c7df24ca 4f459959
...@@ -78,9 +78,9 @@ class EvaluationServiceModel extends \Business\AbstractModel { ...@@ -78,9 +78,9 @@ class EvaluationServiceModel extends \Business\AbstractModel {
//兼容安卓传参 //兼容安卓传参
if(!is_array($images)) $images = json_decode($images, true); if(!is_array($images)) $images = json_decode($images, true);
if(is_array($images) && $images) { if(is_array($images) && $images) {
foreach ($images as $k=>$v) { foreach ($images as $k1=>$v1) {
if(empty($v)) { if(empty($v1)) {
unset($images[$k]); unset($images[$k1]);
} }
} }
}else{ }else{
......
...@@ -1022,7 +1022,6 @@ class RefundServiceModel extends \Business\AbstractModel ...@@ -1022,7 +1022,6 @@ class RefundServiceModel extends \Business\AbstractModel
// $shippingFee == ApiConst::zero; // $shippingFee == ApiConst::zero;
// } // }
$orderGoodsConvert = $orderGoodsDao->getRefundOrderGoods($orderGoods); $orderGoodsConvert = $orderGoodsDao->getRefundOrderGoods($orderGoods);
$returnData = array( $returnData = array(
'orderId' => (int)$orderId, 'orderId' => (int)$orderId,
'orderSn'=>$orderInfo['orderSn'], 'orderSn'=>$orderInfo['orderSn'],
...@@ -1158,8 +1157,9 @@ class RefundServiceModel extends \Business\AbstractModel ...@@ -1158,8 +1157,9 @@ class RefundServiceModel extends \Business\AbstractModel
$storeDao=\DAO\StoreModel::getInstance(); $storeDao=\DAO\StoreModel::getInstance();
$orderDao->setDb(DbNameConst::masterDBConnectName); $orderDao->setDb(DbNameConst::masterDBConnectName);
$orderDao->db->doTransaction(); $orderDao->db->doTransaction();
if($refund['refundType']==ApiConst::refundTypeGoods){ if($refund['refundType']==ApiConst::refundTypeGoods && $refund['refundShippingType']==ApiConst::bySeller){
$refund['refundAmount']-=$orderInfo['needShippingFee']; $refund['refundAmount']-=$orderInfo['needShippingFee'];
} }
$whereRefund['goods_id']=$refund['goodsId']; $whereRefund['goods_id']=$refund['goodsId'];
$whereRefund['buyer_id']=$memberId; $whereRefund['buyer_id']=$memberId;
...@@ -1182,9 +1182,15 @@ class RefundServiceModel extends \Business\AbstractModel ...@@ -1182,9 +1182,15 @@ class RefundServiceModel extends \Business\AbstractModel
$refundAmount = $refund['refundAmount'];//退款金额 $refundAmount = $refund['refundAmount'];//退款金额
if ($orderInfo['paymentTime']) { if ($orderInfo['paymentTime']) {
$maxRefundAmount=$orderGoods['goodsPayPrice']*$orderGoods['goodsNum']; $maxRefundAmount=$orderGoods['goodsPayPrice']*$orderGoods['goodsNum'];
if (($refundAmount < ApiConst::zero) || ($refundAmount > $maxRefundAmount)) { if (($refundAmount < ApiConst::zero)) {
$refundAmount = ApiConst::zero;
}
if($refundAmount > $maxRefundAmount){
$refundAmount = $maxRefundAmount; $refundAmount = $maxRefundAmount;
} }
// if (($refundAmount < ApiConst::zero) || ($refundAmount > $maxRefundAmount)) {
// $refundAmount = $maxRefundAmount;
// }
} else { } else {
$refundAmount = ApiConst::zero; $refundAmount = ApiConst::zero;
} }
......
...@@ -147,7 +147,7 @@ class StoreServiceModel extends \Business\AbstractModel{ ...@@ -147,7 +147,7 @@ class StoreServiceModel extends \Business\AbstractModel{
} }
//处理新店铺信息 //处理新店铺信息
$where = 'store_id not in (select ss.store_id from han_stat_store ss)'; $where = 'store_id not in (select ss.store_id from han_stat_store ss) and is_own_shop=0';
$field = 'store_id,store_state,store_time,store_end_time,province_id,city_id,area_id,(select se.cashed_deposit from han_store_extend se where se.store_id=han_store.store_id) cashed_deposit'; $field = 'store_id,store_state,store_time,store_end_time,province_id,city_id,area_id,(select se.cashed_deposit from han_store_extend se where se.store_id=han_store.store_id) cashed_deposit';
$field .= ',(select count(qs.store_id) from han_qm_store_class qs where qs.is_charged<>0 and qs.store_id=han_store.store_id) class_style1_count, (select count(qs.store_id) from han_qm_store_class qs where qs.is_charged<>0 and qs.class_style=2 and qs.store_id=han_store.store_id) class_style2_count, if((store_state=1 and store_end_time>=0), ifnull((select sum(qs.service_fee) from han_qm_store_class qs where qs.is_charged<>0 and qs.class_style=2 and qs.store_id=han_store.store_id), 0), ifnull((select sum(qs.service_fee) from han_qm_store_class qs where qs.is_charged<>0 and qs.class_style=2 and qs.store_id=han_store.store_id and qs.deadline>=0), 0)) service_fee'; $field .= ',(select count(qs.store_id) from han_qm_store_class qs where qs.is_charged<>0 and qs.store_id=han_store.store_id) class_style1_count, (select count(qs.store_id) from han_qm_store_class qs where qs.is_charged<>0 and qs.class_style=2 and qs.store_id=han_store.store_id) class_style2_count, if((store_state=1 and store_end_time>=0), ifnull((select sum(qs.service_fee) from han_qm_store_class qs where qs.is_charged<>0 and qs.class_style=2 and qs.store_id=han_store.store_id), 0), ifnull((select sum(qs.service_fee) from han_qm_store_class qs where qs.is_charged<>0 and qs.class_style=2 and qs.store_id=han_store.store_id and qs.deadline>=0), 0)) service_fee';
$field .= ',(select count(fs.store_id) from han_favorites_store fs where fs.fav_type=1 and fs.store_id=han_store.store_id) fav_total,(select count(fs.store_id) from han_favorites_store fs where fs.fav_type=1 and fs.fav_from=3 and fs.store_id=han_store.store_id) fav3_total'; $field .= ',(select count(fs.store_id) from han_favorites_store fs where fs.fav_type=1 and fs.store_id=han_store.store_id) fav_total,(select count(fs.store_id) from han_favorites_store fs where fs.fav_type=1 and fs.fav_from=3 and fs.store_id=han_store.store_id) fav3_total';
......
...@@ -646,6 +646,9 @@ class MemberModel extends \DAO\AbstractModel ...@@ -646,6 +646,9 @@ class MemberModel extends \DAO\AbstractModel
} }
public function getListMemberUrl($list){ public function getListMemberUrl($list){
foreach($list as &$li){ foreach($list as &$li){
if(!Common::checkMobilePhone($li['memberMobile'])){
$li['memberMobile']='';
}
$li['memberAvatar']=$this->getMemberAvatarUrl($li['memberId'],$li['memberAvatar']); $li['memberAvatar']=$this->getMemberAvatarUrl($li['memberId'],$li['memberAvatar']);
} }
return $list; return $list;
......
...@@ -230,14 +230,18 @@ class OrderGoodsModel extends \DAO\AbstractModel ...@@ -230,14 +230,18 @@ class OrderGoodsModel extends \DAO\AbstractModel
); );
} }
public function getMustReduceAmount($orderGoodses, $discountAmount, $orderGoods) public function getMustReduceAmount($orderGoodses, $discountAmount, $convertOrderGoods)
{ {
$allNumbers = array_column($orderGoodses, 'goodsNum'); $allMoney=0;
$allNumbers=array_sum($allNumbers); foreach($orderGoodses as &$orderGoods){
$allGoodsPrice = array_column($orderGoodses, 'goodsPrice'); $allMoney+= $orderGoods['goodsNum']*$orderGoods['goodsPrice'];
$allGoodsPrice=array_sum($allGoodsPrice); }
$allMoney = $allNumbers * $allGoodsPrice; // $allNumbers = array_column($orderGoodses, 'goodsNum');
$thisOrderGoodsAmount = $orderGoods['goodsNum'] * $orderGoods['goodsPrice']; // $allNumbers=array_sum($allNumbers);
// $allGoodsPrice = array_column($orderGoodses, 'goodsPrice');
// $allGoodsPrice=array_sum($allGoodsPrice);
// $allMoney = $allNumbers * $allGoodsPrice;
$thisOrderGoodsAmount = $convertOrderGoods['goodsNum'] * $convertOrderGoods['goodsPrice'];
$reduceAmount=($discountAmount*$thisOrderGoodsAmount)/($allMoney); $reduceAmount=($discountAmount*$thisOrderGoodsAmount)/($allMoney);
return round($reduceAmount); return round($reduceAmount);
......
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