Commit 99d5ef87 authored by liuyuzhengrace's avatar liuyuzhengrace

Merge branch 'master' of http://git.shenbd.com/api-project-dev/api.shenbd.com into lyz_cart

parents 80da5b4f 75f5e946
......@@ -133,7 +133,7 @@ class StoreUtil {
$addKey=\Our\Common::getConfig('password.key');
$payLogList = array();
$newChargeList = array();
foreach($list as $class){
foreach($list as $class){
$paySn = date('YmdHis').$this->createncode(18);
$storeId = $class['store_id'];
$payLog = array();
......@@ -160,9 +160,9 @@ class StoreUtil {
$payLog['pay_amount'] = 0;
$chargeLog['gmt_create'] = $currentTime;
$chargeLog['gmt_update'] = $currentTime;
$chargeLog['service_fee_sign'] = md5($currentTime,$chargeLog['service_fee'],$addKey);
$chargeLog['service_fee_sign'] = md5($currentTime.$chargeLog['service_fee'].$addKey);
$newChargeList[] = $chargeLog;
$resultClass = $qmStoreClassModel->update(array('deadline'=>$chargeLog['new_end_time'],'deadline_sign'=>md5($class['gmt_create'],$chargeLog['new_end_time'],$addKey),'gmt_update'=>$currentTime),array('gc_id'=>$chargeLog['gc_id'],'store_id'=>$chargeLog['store_id']));
$resultClass = $qmStoreClassModel->update(array('deadline'=>$chargeLog['new_end_time'],'deadline_sign'=>md5($class['gmt_create'].$chargeLog['new_end_time'].$addKey),'gmt_update'=>$currentTime),array('gc_id'=>$chargeLog['gc_id'],'store_id'=>$chargeLog['store_id']));
if($resultClass===false){
$qmStoreClassModel->db->doRollback();
}
......
......@@ -279,10 +279,12 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
case 1:
$order[] = ['sale_num','DESC'];
$order[] = ['eval_score','DESC'];
$order[] = ['goodsCommonId','DESC'];
$saleSort = true;
break;
case 2:
$order[] = ['sale_num','DESC'];
$order[] = ['goodsCommonId','DESC'];
$saleSort = true;
break;
case 3:
......@@ -297,6 +299,8 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
default:
$order[] = ['sale_num','DESC'];
$order[] = ['eval_score','DESC'];
$order[] = ['goodsCommonId','DESC'];
$saleSort = true;
break;
}
return array($where,$order,$attrStr,$saleSort);
......@@ -458,7 +462,6 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
if($pageSize === 0){
\Error\ErrorModel::throwException(\Error\CodeConfigModel::commonError);
}
$limit = array($pageIndex*$pageSize,$pageSize);
$where = array();
$where[] = "store_id={$storeId}";
......
......@@ -399,11 +399,14 @@ class StoreServiceModel extends \Business\AbstractModel{
public function getRecommendGoods($storeId,$activities){
$storeClassDAO = \DAO\StoreGoodsClassModel::getInstance();
$tempStcs = $storeClassDAO->getList(array('store_id'=>$storeId),'stc_id,stc_name');
$recommendGoods = [];
if($tempStcs) {
$storeClassGoodsDao = \DAO\StoreGoodsClassGoodsModel::getInstance();
$stcGoods = $storeClassGoodsDao->getList('stc_id in('.implode(',',array_column($tempStcs,'stc_id')).')','stc_id,goods_common_id');
foreach ($tempStcs as $stc) {
$recommendGoods[$stc['stc_id']] = array('stcId'=>$stc['stc_id'],'stcName'=>$stc['stc_name'],'goods'=>[]);
}
}
$recommendGoods = [];
if($stcGoods){
$goodsIds = array_column($stcGoods,'goods_common_id');
$goodsCommonDAO = \DAO\GoodsCommonModel::getInstance();
......@@ -412,7 +415,6 @@ class StoreServiceModel extends \Business\AbstractModel{
}else{
$tempGoods = $goodsCommonDAO->getListWithSale(array('han_goods_common.goods_commonid in('.implode(',',$goodsIds).')'),'goods_name,goods_image,goods_price,goods_marketprice,han_goods_common.goods_commonid,IFNULL(discount_price,han_goods_common.goods_price) AS goodsPrice',$activities);
}
if($tempGoods && $tempStcs){
$stcs = [];
foreach ($tempStcs as $v){
......@@ -431,18 +433,19 @@ class StoreServiceModel extends \Business\AbstractModel{
'goodsPrice'=>$goods[$v['goods_common_id']]['goodsPrice'],
'goodsMarketPrice'=>$goods[$v['goods_common_id']]['goods_marketprice'],
];
if(key_exists($v['stc_id'],$recommendGoods)){
if(count($recommendGoods[$v['stc_id']]['goods']) >= 8){
continue;
}
array_push($recommendGoods[$v['stc_id']]['goods'],$good);
}else{
$recommendGoods[$v['stc_id']] = [
'stcId'=>$v['stc_id'],
'stcName'=>$stcs[$v['stc_id']]['stc_name'],
'goods'=>array($good)
];
}
array_push($recommendGoods[$v['stc_id']]['goods'],$good);
// if(key_exists($v['stc_id'],$recommendGoods)){
// if(count($recommendGoods[$v['stc_id']]['goods']) >= 8){
// continue;
// }
// array_push($recommendGoods[$v['stc_id']]['goods'],$good);
// }else{
// $recommendGoods[$v['stc_id']] = [
// 'stcId'=>$v['stc_id'],
// 'stcName'=>$stcs[$v['stc_id']]['stc_name'],
// 'goods'=>array($good)
// ];
// }
}
}
$tempRecommendGoods = array();
......@@ -1344,10 +1347,10 @@ class StoreServiceModel extends \Business\AbstractModel{
foreach ($stores as $store) {
if($store['amount'] >= 400) {
//自动免费续费 当前签约分类租金2个月
$storeUtil->calcChargeMoney(array('month'=>2,'store_end_time'=>$store['store_end_time'],'contract_time'=>$store['contract_time']));
$storeUtil->calcChargeMoney(array($store['store_id']=>array('month'=>2,'store_end_time'=>$store['store_end_time'],'contract_time'=>$store['contract_time'])));
}elseif ($store['amount'] >= 300) {
//自动免费续费 当前签约分类租金1个月
$storeUtil->calcChargeMoney(array('month'=>1,'store_end_time'=>$store['store_end_time'],'contract_time'=>$store['contract_time']));
$storeUtil->calcChargeMoney(array($store['store_id']=>array('month'=>1,'store_end_time'=>$store['store_end_time'],'contract_time'=>$store['contract_time'])));
}
// elseif ($store['amount'] < 30) {
// //查看是否有签约分类续费记录
......
File mode changed from 100755 to 100644
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