Commit 6d271329 authored by zhz's avatar zhz

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

parents 97d4cdcd 7a91e308
File mode changed from 100755 to 100644
......@@ -243,6 +243,9 @@ class OrderConfirmUtil {
}
$reliefAmount = isset($tempStore['reliefAmount'])?$tempStore['reliefAmount']:\Our\ApiConst::zero;
$orderAmount = $tempStore['storeTotalPrice'] - $reliefAmount + $deliveryFee;
if($orderAmount<=\Our\ApiConst::zero){
$orderAmount = \Our\ApiConst::zero;
}
if($orderAmount!=$requestData['totalFee']){
\Error\ErrorModel::throwException(\Error\CodeConfigModel::wrongTotalFeeForOrder);
}
......
......@@ -724,6 +724,8 @@ class CartServiceModel extends \Business\AbstractModel{
$couponDao = \DAO\Coupon\CouponModel::getInstance();
$couponList = array();
foreach($tempCoupons as $tempCoupon){
$tempCoupon['cash_money'] = $tempCoupon['cash_money']*\Our\ApiConst::hundred;
$tempCoupon['order_amount'] = $tempCoupon['order_amount']*\Our\ApiConst::hundred;
$reliefAmount = $this->getOneCouponReliefAmount($tempCoupon,$storeCarts);
if($reliefAmount!==false){
$coupon['couponId'] = $tempCoupon['couponId'];
......
......@@ -90,6 +90,8 @@ class CouponServiceModel extends \Business\AbstractModel{
\Error\ErrorModel::throwException(\Error\CodeConfigModel::emptyCouponId);
}
$coupon = $couponDao->findById($where['couponId']);
$coupon['cash_money'] = $coupon['cash_money']?($coupon['cash_money']/\Our\ApiConst::hundred):\Our\ApiConst::zero;
$coupon['order_amount'] = $coupon['order_amount']?($coupon['order_amount']/\Our\ApiConst::hundred):\Our\ApiConst::zero;
if(!$coupon || $coupon['is_del'] == 1 || time() > $coupon['end_time'] || time() < $coupon['start_time']){
\Error\ErrorModel::throwException(\Error\CodeConfigModel::couponNotExist);
}
......
......@@ -843,14 +843,14 @@ class GroupSaleServiceModel extends \Business\AbstractModel {
$storeExpressNum += $tempObj['goodsNum'];
}
if(isset($storeGcCouponPriceArray[$oneGoodsCommon['gcId']]['totalPrice'])){
$storeGcCouponPriceArray[$oneGoodsCommon['gcId']]['totalPrice'] += $goods['goods_price']*$tempObj['goodsNum'];
$storeGcCouponPriceArray[$oneGoodsCommon['gcId']]['totalPrice'] += $tempObj['goodsPrice']*$tempObj['goodsNum'];
}else{
$storeGcCouponPriceArray[$oneGoodsCommon['gcId']]['totalPrice'] = $goods['goods_price']*$tempObj['goodsNum'];
$storeGcCouponPriceArray[$oneGoodsCommon['gcId']]['totalPrice'] = $tempObj['goodsPrice']*$tempObj['goodsNum'];
}
if(isset($storeGoodsCommonCouponPriceArray[$tempObj['goodsCommonId']]['totalPrice'])){
$storeGoodsCommonCouponPriceArray[$tempObj['goodsCommonId']]['totalPrice'] +=$goods['goods_price']*$tempObj['goodsNum'];
$storeGoodsCommonCouponPriceArray[$tempObj['goodsCommonId']]['totalPrice'] +=$tempObj['goodsPrice']*$tempObj['goodsNum'];
}else{
$storeGoodsCommonCouponPriceArray[$tempObj['goodsCommonId']]['totalPrice'] =$goods['goods_price']*$tempObj['goodsNum'];
$storeGoodsCommonCouponPriceArray[$tempObj['goodsCommonId']]['totalPrice'] =$tempObj['goodsPrice']*$tempObj['goodsNum'];
}
$tempObj['gcId']=$goodsCommonStorages[$goods['goods_commonid']]['gcId'];
$tempObj['gc_id']=$goodsCommonStorages[$goods['goods_commonid']]['gc_id'];
......
......@@ -66,12 +66,13 @@ class OrderServiceModel extends \Business\AbstractModel
// $query2[]= array('match' => array('goodsName' => $keyword));
// $res1['should']=$query2;
// $allQuery['bool']=$res1;
$query1 = array('match' => array('buyerId' => $memberId));
$query1[] = array('match' => array('buyerId' => $memberId));
$query1[] = array('match' => array('deleteState' => ApiConst::undeleteOrder));
$res1['must'][0] = $query1;
// $query2[]= array('match' => array('orderSn' => $keyword"));
$query2[] = array('match' => array('storeName' => $keyword));
$query2[] = array('match' => array('goodsName' => $keyword));
$query2[] = array('wildcard' => array('orderSn' => "*{$keyword}*"));
$res1['must'][1]['bool']['should'] = $query2;
$allQuery['bool'] = $res1;
// echo json_encode($allQuery);exit;
......@@ -84,9 +85,9 @@ class OrderServiceModel extends \Business\AbstractModel
$orderIdsField = array_column($res['list'], 'orderId');
$orderIds = implode(',', $orderIdsField);
if ($orderIds) {
$where = Common::format(" han_order.buyer_id={0} and delete_state={1} and (order_id in({2}) or han_order.order_sn like '%{3}%')", $memberId, ApiConst::undeleteOrder, $orderIds, $keyword);
} else {
$where = Common::format(" han_order.buyer_id={0} and delete_state={1} and han_order.order_sn like '%{2}%'", $memberId, ApiConst::undeleteOrder, $keyword);
$where = Common::format(" order_id in({0})", $orderIds);
}else{
$where=false;
}
return $where;
}
......@@ -105,6 +106,12 @@ class OrderServiceModel extends \Business\AbstractModel
$refundReturnDao = \DAO\Order\RefundReturnModel::getInstance(DbNameConst::salveDBConnectName);
if ($keyWord !== false) {
$where = $this->getOrderIndexWhere($memberId, $keyWord, $pageIndex, $pageSize);
if($where===false){
return Array(
'orders'=>[],
'totalCount'=>ApiConst::zero,
);
}
} else {
$where['delete_state'] = ApiConst::undeleteOrder;
......@@ -118,6 +125,7 @@ class OrderServiceModel extends \Business\AbstractModel
$where['order_state'] = array('in', explode(',', $orderState));
}
}
//获得订单列表
$orders = \Our\RedisHelper::cachedFunction(\Redis\Db5\OrderRedisModel::getInstance(), array(&$orderDao, 'getList'), array($where, $this->orderField, $pageIndex, $pageSize, $order = array('add_time' => 'desc')), \Our\ApiConst::oneDaySecond, array($memberId));
if (!empty($orders['list'])) {
......
......@@ -250,6 +250,7 @@ class RefundServiceModel extends \Business\AbstractModel
$orderGoodsConvert = $orderGoodsDao->getRefundOrderGoods($orderGoods);
$returnData = array(
'orderId' => (int)$orderId,
'orderSn'=>$orderInfo['orderSn'],
'needShippingFee' => $orderInfo['needShippingFee'],
'shippingType' => $orderInfo['shippingType'],
'shippingFee' => $shippingFee,
......
......@@ -577,7 +577,7 @@ class ShopkeeperServiceModel extends \Business\AbstractModel
{
$elasticsTool = ElasticsToolModel::getInstance('orders');
$elasticsTool->deleteIndex();
// $elasticsTool->deleteIndex();
$indexsFiled = array(
'goodsName' => array(
'type' => 'string',
......
......@@ -23,8 +23,8 @@ class CouponModel extends \DAO\AbstractModel {
*/
protected $_primaryKey = 'id';
protected $availStoreIndexField = 'id,type,cash_money,order_amount,discount,store_id,coupon_type,is_overlay,start_time,end_time,gift_coupon_id';
protected $availCartStoreIndexField = 'id,type,cash_money,order_amount,discount,store_id,coupon_type,is_overlay,start_time,end_time,ids,gift_coupon_id,gift_goods_ids';
protected $availStoreIndexField = 'id,type,FORMAT(cash_money/100,2) as cash_money,FORMAT(order_amount/100,2) as order_amount,discount,store_id,coupon_type,is_overlay,start_time,end_time,gift_coupon_id';
protected $availCartStoreIndexField = 'id,type,FORMAT(cash_money/100,2) as cash_money,FORMAT(order_amount/100,2) as order_amount,discount,store_id,coupon_type,is_overlay,start_time,end_time,ids,gift_coupon_id,gift_goods_ids';
public function init(){
......@@ -221,8 +221,8 @@ class CouponModel extends \DAO\AbstractModel {
return $coupons;
}
public function getCartCouponTitles($where){
$coupons = $this->getList($where,$this->availCartStoreIndexField);
public function getCartCouponTitles($where,$field = 'id,type,FORMAT(cash_money/100,2) as cash_money,FORMAT(order_amount/100,2) as order_amount,discount,store_id,coupon_type,is_overlay,start_time,end_time,ids,gift_coupon_id,gift_goods_ids'){
$coupons = $this->getList($where,$field);
if($coupons){
$result = array();
foreach($coupons as $coupon){
......
......@@ -21,7 +21,7 @@ class MemberFavoritesStoreStoreMemberStatisticsModel extends \DAO\AbstractModel
*/
protected $_tableName = 'han_member-favorites_store-store_member_statistics';
public $field="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";
/**
* 主键
*
......@@ -65,13 +65,18 @@ class MemberFavoritesStoreStoreMemberStatisticsModel extends \DAO\AbstractModel
$this->setDb($this->dbName);
$whereStr=" store_id=".$storeId;
if(!empty($keyword)){
$whereStr.=Common::format(" and(member_name='{0}' or member_mobile='{1}') ",$keyword);
$whereStr.=Common::format(" and(member_name like '%{0}%' or member_mobile like '%{0}%') ",$keyword);
}
$result=$this->lists($whereStr, $sort, $this->field, $pageIndex, $pageSize);
if(!empty($result['list'])){
$result['list']=$this->getListNotNull($result['list']);
foreach($result['list'] as $key=>$val){
$result['list'][$key]['isBacklist']=$val['isBacklist']?$val['isBacklist']:ApiConst::zero;
if($val['favType']==ApiConst::two){
$result['list'][$key]['isBacklist']=ApiConst::one;
}else{
$result['list'][$key]['isBacklist']=ApiConst::zero;
}
// $result['list'][$key]['isBacklist']=$val['isBacklist']?$val['isBacklist']:ApiConst::zero;
$result['list'][$key]['orderTotal']=$val['orderTotal']?$val['orderTotal']:ApiConst::zero;
$result['list'][$key]['orderGoodsCount']=$val['orderGoodsCount']?$val['orderGoodsCount']:ApiConst::zero;
}
......
......@@ -60,7 +60,7 @@ class StoreMemberModel extends \DAO\AbstractModel{
foreach($datas as $key => $data){
$sql .=\Our\Common::format(" (store_id={0} and member_id = {1} and type={2} ),",$data['storeId'],$data['memberId'],$data['type']);
}
$sql = substr($sql,0,strlen($sql)-1);
$sql = trim($sql,',');
$sql .= ";";
$res = $this->db->insert($this->_tableName)->query($sql);
return $res;
......
......@@ -71,7 +71,7 @@ class cliShopkeeperIndex extends basecli
$shopkeeperService->baseDir= \Our\Common::getConfig('out.config');
try {
$shopkeeperService->insertStoreMemberStatics();
$shopkeeperService->reduceStoreMemberStatics();
// $shopkeeperService->reduceStoreMemberStatics();
$shopkeeperService->storeStatictisTask();
$shopkeeperService->updateLastId();
} catch (Exception $ex) {
......
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