Commit 3c16aae5 authored by zhz's avatar zhz

goods

parent b817946e
......@@ -101,7 +101,7 @@ class Common
return $url;
}
function is_https() {
public static function is_https() {
if ( !empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off') {
return true;
} elseif ( isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https' ) {
......
......@@ -23,6 +23,9 @@ class GroupSaleServiceModel extends \Business\AbstractModel {
public function getGroupGoods($param){
$groupId = intval($param['groupId']);
$groupList = $this->getPBundlingListByBlIds(array($groupId));
if(!$groupList){
\Error\ErrorModel::throwException(\Error\CodeConfigModel::emptyPBundlingdForOrder);
}
$data = $groupList[0];
if($data['goodsCountFlag'] === false){
$data['state'] = 0;
......
......@@ -105,7 +105,7 @@ class FootprintServiceModel extends \Business\AbstractModel
$field = 'bl_id AS blId,bl_name AS name,bl_title,store_id,store_name,bl_state,bl_quota_starttime,bl_image,bl_storage,bl_discount_price AS discountPrice,bl_sum_price AS sumPrice,bl_quota_endtime AS endTime,image,is_transport,transport_id';
$pbundlingInstance = \DAO\PBundlingModel::getInstance();
$where2 = ' bl_id in ('.implode(',',$groupIds).')';
$groupList = \Our\RedisHelper::cachedFunction(\Redis\Db4\PBundlingRedisModel::getInstance(), array(&$pbundlingInstance, 'getList'), array($field,$where2), \Our\ApiConst::oneDaySecond);
$groupList = \Our\RedisHelper::cachedFunction(\Redis\Db4\PBundlingRedisModel::getInstance(), array(&$pbundlingInstance, 'getList'), array($field,$where2), \Our\ApiConst::oneMinute);
if($groupList) {
$dates = array_column($browseList,'browsedate','group_id');
foreach ($groupList as $group) {
......
......@@ -38,7 +38,7 @@ class PBundlingModel extends \DAO\AbstractModel {
if(is_array($where)){
$where = $this->db->getSqlWhereByArray($where);
}
return $this->db->select($field)->from($this->_tableName)->where($where)->where("bl_quota_starttime <= ".time())->where('bl_quota_endtime >= '.time())->where('bl_state=1')->limit($limit[0],$limit[1])->fetchAll();
return $this->db->select($field)->from($this->_tableName)->where($where)->where("bl_quota_starttime <= ".time())->where('bl_quota_endtime >= '.time())->where('bl_state=1')->where('is_del=0')->limit($limit[0],$limit[1])->fetchAll();
}
public function getImgPath($image){
if($image){
......@@ -48,11 +48,11 @@ class PBundlingModel extends \DAO\AbstractModel {
public function getDetail($where,$field,$limit=false){
$this->setDb($this->dbName);
return $this->db->select($field)->from($this->_tableName)->join('han_p_bundling_goods',"han_p_bundling_goods.bl_id = han_p_bundling.bl_id",'inner')->where($where)->where("bl_quota_starttime <= ".time())->where('bl_quota_endtime >= '.time())->where('bl_state=1')->limit($limit[0],$limit[1])->fetchAll();
return $this->db->select($field)->from($this->_tableName)->join('han_p_bundling_goods',"han_p_bundling_goods.bl_id = han_p_bundling.bl_id",'inner')->where($where)->where("bl_quota_starttime <= ".time())->where('bl_quota_endtime >= '.time())->where('bl_state=1')->where('is_del=0')->limit($limit[0],$limit[1])->fetchAll();
}
public function getCount($where){
$this->setDb($this->dbName);
return $this->db->from($this->_tableName)->where($where)->where("bl_quota_starttime <= ".time())->where('bl_quota_endtime >= '.time())->where('bl_state=1')->fetchNum();
return $this->db->from($this->_tableName)->where($where)->where("bl_quota_starttime <= ".time())->where('bl_quota_endtime >= '.time())->where('bl_state=1')->where('is_del=0')->fetchNum();
}
......
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