Commit 865dadc7 authored by chenchuanwen's avatar chenchuanwen

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

parents a9c78a18 7f132f3b
......@@ -161,7 +161,7 @@ class CartController extends \Our\Controller_AbstractApi{
$sess=\Yaf\Session::getInstance();
$currentAddress = $sess->get('currentAddress');
$result = $cartService->addOrder($data,$this->memberId,$currentAddress);
$result = $cartService->addOrder($data, $this->memberId,$currentAddress);
$this->success($result);
}
......
......@@ -147,8 +147,8 @@ class OrderConfirmUtil {
$storeCartData = array('cartList'=>$cartList['list'],'storeIds'=>array_keys($cartList['list']),'goodsIds'=>$storeCartList['goodsIds'],'goodsCommonIds'=>$storeCartList['goodsCommonIds'],'blIds'=>$storeCartList['blIds'],'gcIds'=>$gcIds);
}
if($this->storeCouponIds&&$this->couponIds){
$storeCartData = $this->checkCouponForOrder($storeCartData,$this->memberId);
if ($this->storeCouponIds&&$this->couponIds) {
$storeCartData = $this->checkCouponForOrder($storeCartData, $this->memberId);
}
return $storeCartData;
......
......@@ -319,13 +319,15 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
$endTime = TIMESTAMP;
$where = 'goods_edittime > '.$beginTime.' and goods_edittime<=' . $endTime . ' and goods_id in (select sg.goods_id from han_stat_goods sg)';
$field = 'goods_id,is_del,goods_name,goods_storage,goods_price,store_id';
$field = 'goods_id,goods_commonid,is_del,goods_name,goods_storage,goods_price,store_id';
$result = true;
$goodsDao = \DAO\GoodsModel::getInstance();
$storeDao = \DAO\StoreModel::getInstance();
$statGoodsDao = \DAO\StatGoodsModel::getInstance(DbNameConst::masterDBConnectName);
$store_tmp = array();
$count = $statGoodsDao->getCountByWhere('1=1');
if($count > 0) {
if($datas = $goodsDao->getList($where, $field)) { //更新商品报表
echo 'in:'.count($datas);
foreach ($datas as $key=>$val) {
......@@ -346,6 +348,9 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
}
}
}
} else {
file_put_contents($this->baseDir . \Our\PathConst::goodsSellStatTime, '0');
}
$where = 'goods_id not in (select sg.goods_id from han_stat_goods sg)';
if($datas = $goodsDao->getList($where, $field)) { //插入高品报表
......@@ -368,9 +373,13 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
}
}
}
echo "\n";
if($result) { //商品报表更新成功
file_put_contents($this->baseDir . \Our\PathConst::goodsStatTime, $endTime);
echo "upd goods succ";
} else {
echo "upd goods fail";
}
return $result;
}
......@@ -382,7 +391,6 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
* Time: 下午 6:19
*/
public function updateStatGoodsSell(){
file_put_contents($this->baseDir . \Our\PathConst::goodsSellStatTime, '');
$beginTime = file_get_contents($this->baseDir . \Our\PathConst::goodsSellStatTime, TIMESTAMP);
$beginTime = $beginTime ? $beginTime : ApiConst::zero;
$endTime = TIMESTAMP;
......@@ -419,8 +427,12 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
}
}
if(!$result) {
echo "\n";
echo 'upd sell fail';
$statGoodsDao->db->doRollback();
} else { //商品报表更新成功
echo "\n";
echo 'upd sell succ';
$statGoodsDao->db->doCommit();
file_put_contents($this->baseDir . \Our\PathConst::goodsSellStatTime, $endTime);
}
......
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