Commit b2a1deb3 authored by liuyuzhen's avatar liuyuzhen

商品分类

parent 31eb0c7b
......@@ -24,6 +24,7 @@ class CouponModel extends \DAO\AbstractModel {
protected $_primaryKey = 'id';
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 $availTitleField = '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,ids';
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(){
......@@ -149,7 +150,7 @@ class CouponModel extends \DAO\AbstractModel {
* @throws \Our\Exception
*/
public function getStorePromotionCouponList($storeId){
$field = $this->availStoreIndexField;
$field = $this->availTitleField;
$where = ' and store_id ='.$storeId.' and type<>1';
$this->setDb($this->dbName);
//$coupons = $this->getOnlineCouponList($where,$field);
......@@ -166,22 +167,20 @@ class CouponModel extends \DAO\AbstractModel {
if($storeClasses){
$storeClassIds = array_column($storeClasses,'gc_id');
}
$storeCouponGoodsClassDao = \DAO\GoodsClass\StoreCouponGoodsClassModel::getInstance();
$result = array();
foreach($coupons as $coupon){
if(!($coupon['start_time']<=TIMESTAMP&&$coupon['end_time']>TIMESTAMP)){
continue;
}
if($coupon['type']==\Our\ApiConst::goodsClassCoupon){ //指定品类优惠券,需要判断该优惠券对应分类店铺是否在经营
if($storeClassIds){
$gcIds = $storeCouponGoodsClassDao->getGoodsClassIdsByCouponId($coupon['id']);
if(!$gcIds){
continue;
}
if($storeClassIds&&$coupon['ids']){
$gcIds = explode(',',trim($coupon['ids'],','));
$gcIdList = array_intersect($storeClassIds,$gcIds);
if(!$gcIdList){
if(count($gcIdList)!=count($gcIds)){
continue;
}
}else{
continue;
}
}
$temp = array();
......
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