Commit a437d290 authored by zhz's avatar zhz

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

parents cf2e3de9 a8812ef4
...@@ -61,7 +61,7 @@ class UserController extends \Our\Controller_AbstractIndex { ...@@ -61,7 +61,7 @@ class UserController extends \Our\Controller_AbstractIndex {
$this->memberService->clearKey($this->key); $this->memberService->clearKey($this->key);
$this->key=Common::bulidToken($mobile,$password); $this->key=Common::bulidToken($mobile,$password);
session_id($this->key); session_id($this->key);
$this->sess['member_id']=$member['member_id']; $this->sess['member_id']=(int)$member['member_id'];
$this->sess[NameConst::sessionKey]=$this->key; $this->sess[NameConst::sessionKey]=$this->key;
$member[NameConst::sessionKey]=$this->key; $member[NameConst::sessionKey]=$this->key;
$this->memberService->saveMember($member); $this->memberService->saveMember($member);
......
...@@ -111,4 +111,8 @@ class ImageConst{ ...@@ -111,4 +111,8 @@ class ImageConst{
const groupGoodsImg = 160; //组合详情页的搭配商品 const groupGoodsImg = 160; //组合详情页的搭配商品
const storeGroupImg = 186; //店铺促销 const storeGroupImg = 186; //店铺促销
const storeGroupGoodsImg = 130; const storeGroupGoodsImg = 130;
const cartBlImage = 184;
const cartBlDetailImage = 148;
} }
...@@ -186,6 +186,7 @@ class CartServiceModel extends \Business\AbstractModel{ ...@@ -186,6 +186,7 @@ class CartServiceModel extends \Business\AbstractModel{
}else if($cart['type'] == \Our\ApiConst::addBundingToCart){ }else if($cart['type'] == \Our\ApiConst::addBundingToCart){
$newCart = $this->getPBundlingGoodsCartData($data['goodsNum'],$memberId,$pBundling); $newCart = $this->getPBundlingGoodsCartData($data['goodsNum'],$memberId,$pBundling);
} }
unset($newCart['newCarts'][0]['gmt_update']);
return $newCart; return $newCart;
} }
...@@ -448,7 +449,6 @@ class CartServiceModel extends \Business\AbstractModel{ ...@@ -448,7 +449,6 @@ class CartServiceModel extends \Business\AbstractModel{
$field = 'MAX(gmt_update) AS gmtupdate,store_id'; $field = 'MAX(gmt_update) AS gmtupdate,store_id';
$group = 'store_id'; $group = 'store_id';
$storeIds = $cartDao->getCartStoreIdsByMemberId($where,$memberId,$field,$group,$order); $storeIds = $cartDao->getCartStoreIdsByMemberId($where,$memberId,$field,$group,$order);
\Our\Log::getInstance()->write(json_encode($storeIds));
//$cartStores = $cartDao->lists($where,$order,$field,$data['pageIndex'],$data['pageSize'],$group); //$cartStores = $cartDao->lists($where,$order,$field,$data['pageIndex'],$data['pageSize'],$group);
$storeIdList = array_column($storeIds,'store_id'); $storeIdList = array_column($storeIds,'store_id');
$totalCount = count($storeIdList); $totalCount = count($storeIdList);
......
...@@ -114,6 +114,7 @@ class GroupSaleServiceModel extends \Business\AbstractModel { ...@@ -114,6 +114,7 @@ class GroupSaleServiceModel extends \Business\AbstractModel {
//$pBundlingList = $this->getGroupListForCart($blIds); //$pBundlingList = $this->getGroupListForCart($blIds);
//var_dump($pBundlingList); //var_dump($pBundlingList);
$pBundlingList = $this->getPBundlingListByBlIds($blIds,\Our\DbNameConst::salveDBConnectName,true); $pBundlingList = $this->getPBundlingListByBlIds($blIds,\Our\DbNameConst::salveDBConnectName,true);
$pBundlingList = $this->getResizeGroupSaleGoodsList($pBundlingList);
} }
$goodsCommonIds = $cartListData['goodsCommonIds']; $goodsCommonIds = $cartListData['goodsCommonIds'];
$goodsIds = $cartListData['goodsIds']; $goodsIds = $cartListData['goodsIds'];
...@@ -138,7 +139,7 @@ class GroupSaleServiceModel extends \Business\AbstractModel { ...@@ -138,7 +139,7 @@ class GroupSaleServiceModel extends \Business\AbstractModel {
$tempObj['goodsName'] = $tempCart['goods_name']; $tempObj['goodsName'] = $tempCart['goods_name'];
$tempObj['goodsPrice'] = $tempCart['goods_price']; $tempObj['goodsPrice'] = $tempCart['goods_price'];
$tempObj['goodsNum'] = $tempCart['goods_num']; $tempObj['goodsNum'] = $tempCart['goods_num'];
$tempObj['goodsImage'] = \Our\ImageUtil::getGoodsImgUrl($tempCart['goods_image']); $tempObj['goodsImage'] = \Our\ImageUtil::getGoodsImgUrl($tempCart['goods_image'],\Our\ImageConst::cartBlImage);
$tempObj['type'] = $tempCart['type']; $tempObj['type'] = $tempCart['type'];
if ($tempCart['type'] == \Our\ApiConst::addBundingToCart) { if ($tempCart['type'] == \Our\ApiConst::addBundingToCart) {
$pBundling = isset($pBundlingList[$tempCart['goods_id']])?$pBundlingList[$tempCart['goods_id']]:array(); $pBundling = isset($pBundlingList[$tempCart['goods_id']])?$pBundlingList[$tempCart['goods_id']]:array();
...@@ -164,13 +165,15 @@ class GroupSaleServiceModel extends \Business\AbstractModel { ...@@ -164,13 +165,15 @@ class GroupSaleServiceModel extends \Business\AbstractModel {
if($tempPrice){ if($tempPrice){
$tempObj['goodsPrice'] = $tempPrice; $tempObj['goodsPrice'] = $tempPrice;
} }
$tempObj['goodsImage'] = $pBundling['image'];
$tempObj['goodsList'] = \Our\Common::convertUnderline($pBundling['goodsList']); $tempObj['goodsList'] = \Our\Common::convertUnderline($pBundling['goodsList']);
$tempObj['goodsOriginalPrice'] = $pBundling['sumPrice']; $tempObj['goodsOriginalPrice'] = $pBundling['sumPrice'];
} else if ($tempCart['type'] == \Our\ApiConst::addGoodsToCart) { } else if ($tempCart['type'] == \Our\ApiConst::addGoodsToCart) {
$goodsStorage = isset($goodsCommonStorages[$tempCart['goods_commonid']][$tempCart['goods_id']])?$goodsCommonStorages[$tempCart['goods_commonid']][$tempCart['goods_id']]:array();//$goodsDao->getOnlineStorageGoods($tempCart['goods_id']); $goodsStorage = isset($goodsCommonStorages[$tempCart['goods_commonid']][$tempCart['goods_id']])?$goodsCommonStorages[$tempCart['goods_commonid']][$tempCart['goods_id']]:array();//$goodsDao->getOnlineStorageGoods($tempCart['goods_id']);
if($goodsStorage){ if($goodsStorage){
if(isset($goodsStorage['goods_image'])&&$goodsStorage['goods_image']){ if(isset($goodsStorage['goods_image'])&&$goodsStorage['goods_image']){
$tempObj['goodsImage'] = \Our\ImageUtil::getGoodsImgUrl($goodsStorage['goods_image']); $tempObj['goodsImage'] = \Our\ImageUtil::getGoodsImgUrl($goodsStorage['goods_image'],\Our\ImageConst::cartBlImage);
} }
if ($goodsStorage['onlineFlag'] == \Our\ApiConst::one) { if ($goodsStorage['onlineFlag'] == \Our\ApiConst::one) {
if($goodsStorage['goodsStorage']>\Our\ApiConst::zero){ if($goodsStorage['goodsStorage']>\Our\ApiConst::zero){
...@@ -353,6 +356,24 @@ class GroupSaleServiceModel extends \Business\AbstractModel { ...@@ -353,6 +356,24 @@ class GroupSaleServiceModel extends \Business\AbstractModel {
return $return; return $return;
} }
public function getResizeGroupSaleGoodsList($pbundingList, $blImageWidth = \Our\ImageConst::cartBlImage,$blDetailImageWidth = \Our\ImageConst::cartBlDetailImage){
$groupList = array();
foreach ($pbundingList as $k=>$v){
$v['image'] = ImageUtil::getGoodsImgUrl($v['image'],$blImageWidth);
if($v['goodsList']){
$goods = array();
foreach ($v['goodsList'] as $v2){
$v2['goodsImage'] = ImageUtil::getGoodsImgWithUrl($v2['goodsImage'],$blDetailImageWidth);
$goods[] = $v2;
}
$v['goodsList'] = $goods;
}
$groupList[$k] = $v;
}
return $groupList;
}
/** /**
* 获取组合销售与商品列表 * 获取组合销售与商品列表
* @param $param * @param $param
......
...@@ -61,6 +61,7 @@ class ShopkeeperServiceModel extends \Business\AbstractModel ...@@ -61,6 +61,7 @@ class ShopkeeperServiceModel extends \Business\AbstractModel
//获取店铺数据统计 //获取店铺数据统计
//$storeStats = $storeStatisticsDao->find($condition); //$storeStats = $storeStatisticsDao->find($condition);
//获取店铺今日销售额和订单量 //获取店铺今日销售额和订单量
// $storeStats=$orderDao->getShopKeeperCountByStoreId($storeId);
$storeStats = $orderDao->getShopKeeperCountByStoreIdCache($storeId); $storeStats = $orderDao->getShopKeeperCountByStoreIdCache($storeId);
$storeFavariteCount=$favoritesStoreDao->getFavoritesCountByStoreIdCache($storeId); $storeFavariteCount=$favoritesStoreDao->getFavoritesCountByStoreIdCache($storeId);
$data['storeId'] = $store['store_id']; $data['storeId'] = $store['store_id'];
...@@ -683,6 +684,9 @@ class ShopkeeperServiceModel extends \Business\AbstractModel ...@@ -683,6 +684,9 @@ class ShopkeeperServiceModel extends \Business\AbstractModel
$storeMemberStatisticData = $refundReturnDao->getMemberStoreStaticsByGmtUpdate($gmtUpdate, $this->taskIndex, $this->taskSize); $storeMemberStatisticData = $refundReturnDao->getMemberStoreStaticsByGmtUpdate($gmtUpdate, $this->taskIndex, $this->taskSize);
$storeMemberStatisticData = isset($storeMemberStatisticData['list']) ? $storeMemberStatisticData['list'] : false; $storeMemberStatisticData = isset($storeMemberStatisticData['list']) ? $storeMemberStatisticData['list'] : false;
if(!empty($storeMemberStatisticData)){ if(!empty($storeMemberStatisticData)){
foreach($storeMemberStatisticData as $item){
$orderDao->deleteOrderCache($item['buyerId'],$item['orderId'],$item['storeId'],true,true);
}
$orderIds=array_column($storeMemberStatisticData,'orderId'); $orderIds=array_column($storeMemberStatisticData,'orderId');
foreach($orderIds as $orderId){ foreach($orderIds as $orderId){
$res=$orderGoodsDao->find(array('order_id'=>$orderId,'refund_id'=>ApiConst::zero)); $res=$orderGoodsDao->find(array('order_id'=>$orderId,'refund_id'=>ApiConst::zero));
......
...@@ -71,14 +71,17 @@ class AddressServiceModel extends \Business\AbstractModel { ...@@ -71,14 +71,17 @@ class AddressServiceModel extends \Business\AbstractModel {
}else { }else {
if($currentAddress){ if($currentAddress){
if($currentAddress['addressId']&&$currentAddress['chooseFlag']){ if($currentAddress['addressId']&&$currentAddress['chooseFlag']){
$address['addressId'] = $currentAddress['addressId']; $addresses = array();
$address['address'] = $currentAddress['address']; if($currentAddress['addressId'] >\Our\ApiConst::zero){
$address['name'] = $currentAddress['name']; $address['addressId'] = $currentAddress['addressId'];
$address['tagType'] = $currentAddress['tagType']; $address['address'] = $currentAddress['address'];
$address['lat'] = $currentAddress['lat']; $address['name'] = $currentAddress['name'];
$address['lng'] = $currentAddress['lng']; $address['tagType'] = $currentAddress['tagType'];
$address['cityCode'] = $currentAddress['cityCode']; $address['lat'] = $currentAddress['lat'];
$addresses[] = $address; $address['lng'] = $currentAddress['lng'];
$address['cityCode'] = $currentAddress['cityCode'];
$addresses[] = $address;
}
$returnAddress = array('returnAddressId'=>$currentAddress['addressId'],'choosedAddressFlag'=>$currentAddress['chooseFlag'],'addresses'=>$addresses); $returnAddress = array('returnAddressId'=>$currentAddress['addressId'],'choosedAddressFlag'=>$currentAddress['chooseFlag'],'addresses'=>$addresses);
}else{ }else{
......
...@@ -383,10 +383,18 @@ class OrderModel extends \DAO\AbstractModel ...@@ -383,10 +383,18 @@ class OrderModel extends \DAO\AbstractModel
public function getSumAmountCountByMemberAndStoreId($storeIds,$memberIds) public function getSumAmountCountByMemberAndStoreId($storeIds,$memberIds)
{ {
$this->setDb($this->dbName); $this->setDb($this->dbName);
$where['store_id']=array('in',$storeIds); if(is_array($storeIds)){
$where['member_ids']=array('in',$memberIds); $storeIds=implode(',',$storeIds);
$where['order_state']=array('notin','-1,0'); }
$res=$this->db->from($this->_tableName)->select(" buyer_id as buyerId,store_id as storeId,sum(order_amount) as orderTotal")->group('buyer_id')->group('store_id')->fetchAll(); if(is_array($memberIds)){
$memberIds=implode(',',$memberIds);
}
$where=Common::format(" store_id in({0}) and buyer_id in({1}) and order_state not in({2})",$storeIds,$memberIds,'-1,0');
// $where['store_id']=array('in',$storeIds);
// $where['buyer_id']=array('in',$memberIds);
// $where['order_state']=array('notin','-1,0');
// $where=$this->db->getSqlWhereByArray($where);
$res=$this->db->from($this->_tableName)->where($where)->select(" buyer_id as buyerId,store_id as storeId,(SUM(order_amount)-SUM(refund_amount)) AS orderTotal")->group('buyer_id')->group('store_id')->fetchAll();
return $res; return $res;
} }
......
...@@ -755,7 +755,7 @@ class CodeConfigModel { ...@@ -755,7 +755,7 @@ class CodeConfigModel {
self::noExpressDeliveryForOrder1 => '该店铺未配置快递配送', self::noExpressDeliveryForOrder1 => '该店铺未配置快递配送',
self::goodsNoStoreForCartOrOrder1 => '商品库存紧张,您的购买数量太多啦', self::goodsNoStoreForCartOrOrder1 => '商品库存紧张,您的购买数量太多啦',
self::noEnoughStorageForBundlingGoods =>'组合销售库存紧张,您购买的数量太多啦', self::noEnoughStorageForBundlingGoods =>'组合销售库存紧张,您购买的数量太多啦',
self::noOrderWaitToPay => '您的订单已支付,请勿重复重复', self::noOrderWaitToPay => '您的订单已支付,请勿重复支付',
//销售员 //销售员
self::emptySaleGoodsId=>'商品id不能为空', self::emptySaleGoodsId=>'商品id不能为空',
self::emptySaleGoods=>'销售商品不存在', self::emptySaleGoods=>'销售商品不存在',
......
...@@ -261,3 +261,45 @@ elastic.master.scheme="http"; ...@@ -261,3 +261,45 @@ elastic.master.scheme="http";
;resources.database.params.database = "database" ;resources.database.params.database = "database"
;resources.database.params.username = "username" ;resources.database.params.username = "username"
;resources.database.params.password = "password" ;resources.database.params.password = "password"
[ccw : common]
; 数据库配置
resources.database.params.driver = "pdo_mysql"
resources.database.params.hostname = "127.0.0.1"
resources.database.params.port = 3306
resources.database.params.database = "qmcs"
resources.database.params.username = "root"
resources.database.params.password = "root"
resources.database.params.charset = "UTF8"
resources.database.params.driver_options.1002 = "SET NAMES utf8"
; 从库配置
resources.database.slave.params.driver = "pdo_mysql"
resources.database.slave.params.hostname = "127.0.0.1"
resources.database.slave.params.port = 3306
resources.database.slave.params.database = "qmcs"
resources.database.slave.params.username = "root"
resources.database.slave.params.password = "root"
resources.database.slave.params.charset = "UTF8"
resources.database.slave.params.driver_options.1002 = "SET NAMES utf8"
redis.database.params.host = "127.0.0.1"
redis.database.params.port = "6379"
redis.database.params.prefix = "qm_"
;redis.database.params.password = "23456ertyu"
out.config="/data/config";
;锁文件
out.locks="/data/locks";
; redis配置
;redis.database.params.password = "test"
;推送配置
push.clientHost="ws://192.168.80.18:9502"
push.host="192.168.80.18"
push.port="9503"
push.open=1
elastic.master.host="192.168.1.201"
elastic.master.port="9200"
elastic.master.scheme="http";
...@@ -115,3 +115,22 @@ config.url.convert="/usr/local/bin/wkhtmltoimage"; ...@@ -115,3 +115,22 @@ config.url.convert="/usr/local/bin/wkhtmltoimage";
config.url.indexUrl="/www/local.qm.com/application/library/React" config.url.indexUrl="/www/local.qm.com/application/library/React"
config.url.libary="/www/local.qm.com/application/library" config.url.libary="/www/local.qm.com/application/library"
; 文件目录 ; 文件目录
[ccw : common]
; url相关配置
config.url.resourcesHost = "http://local.qm.com"
; 用户中心host
config.url.userHost = ""
; oss 域名
config.url.ossHost = "http://qmoss-01.oss-cn-hangzhou.aliyuncs.com"
;推送域名
config.url.pushHost="127.0.0.1:9503";
config.url.convert="/usr/local/bin/wkhtmltoimage";
config.url.indexUrl="/www/local.qm.com/application/library/React"
config.url.libary="/www/local.qm.com/application/library"
; 文件目录
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