Commit 9f4abe0f authored by wwccw0591's avatar wwccw0591

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

parents f445057f 4b78cbc9
......@@ -63,9 +63,9 @@ class ArrayConst
//系统默认地址
const defaultAddress = array(
NameConst::cityCode => '0591',
NameConst::lat => '26.053183',
NameConst::lng => '119.24174',
NameConst::address => '横一号路特力林科技大厦',
NameConst::lat => '26.043194',
NameConst::lng => '119.331196',
NameConst::address => '福远文创园',
'default'=>\Our\ApiConst::one
);
......
......@@ -347,13 +347,15 @@ class Common
* @param array $data
* @return array
*/
public static function convertHump(array $data){
public static function convertHump($data = array()){
$result = [];
foreach ($data as $key => $item) {
if (is_array($item) || is_object($item)) {
$result[self::humpToLine($key)] = self::convertHump((array)$item);
} else {
$result[self::humpToLine($key)] = $item;
if($data){
foreach ($data as $key => $item) {
if (is_array($item) || is_object($item)) {
$result[self::humpToLine($key)] = self::convertHump((array)$item);
} else {
$result[self::humpToLine($key)] = $item;
}
}
}
return $result;
......@@ -365,13 +367,15 @@ class Common
* @param array $data
* @return array
*/
public static function convertUnderline(array $data){
public static function convertUnderline( $data=array()){
$result = [];
foreach ($data as $key => $item) {
if (is_array($item) || is_object($item)) {
$result[self::underlineToHump($key)] = self::convertUnderline((array)$item);
} else {
$result[self::underlineToHump($key)] = $item;
if($data){
foreach ($data as $key => $item) {
if (is_array($item) || is_object($item)) {
$result[self::underlineToHump($key)] = self::convertUnderline((array)$item);
} else {
$result[self::underlineToHump($key)] = $item;
}
}
}
return $result;
......
......@@ -107,7 +107,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::oneMinute);
$groupList = \Our\RedisHelper::cachedFunction(\Redis\Db4\PBundlingRedisModel::getInstance(), array(&$pbundlingInstance, 'getList'), array($field,$where2,[],\Our\ApiConst::one), \Our\ApiConst::oneMinute);
if($groupList) {
$dates = array_column($browseList,'browsedate','group_id');
foreach ($groupList as $group) {
......
......@@ -381,7 +381,7 @@ class CouponModel extends \DAO\AbstractModel {
if($coupon['coupon_type'] ==\Our\ApiConst::fullMinusCouponType&&($totalPrice>\Our\ApiConst::zero&&$totalPrice>=$coupon['order_amount'])){ //指定品类满减券
$reliefAmount = $coupon['cash_money'];
}else if($coupon['coupon_type'] ==\Our\ApiConst::discountCouponType&&($totalPrice>=$coupon['order_amount']||$coupon['order_amount']==\Our\ApiConst::zero)){//指定品类折扣券,可能没有订单限制,或有订单金额限制
$reliefAmount = round($totalPrice * $coupon['discount']/\Our\ApiConst::ten,\Our\ApiConst::zero);
$reliefAmount = round($totalPrice * (\Our\ApiConst::ten-$coupon['discount'])/\Our\ApiConst::ten,\Our\ApiConst::zero);
}else if(($coupon['coupon_type']== \Our\ApiConst::fullForCouponCouponType)
&&($totalPrice>\Our\ApiConst::zero&&$totalPrice>=$coupon['order_amount'])){
$reliefAmount = \Our\ApiConst::zero;
......
......@@ -46,9 +46,9 @@ class PBundlingModel extends \DAO\AbstractModel {
if(is_array($where)){
$where = $this->db->getSqlWhereByArray($where);
}
$this->db->select($field)->from($this->_tableName)->where($where)->where("bl_quota_starttime <= ".time())->where('bl_quota_endtime >= '.time())->where('bl_state=1');
$this->db->select($field)->from($this->_tableName)->where($where);
if($isDel==\Our\ApiConst::zero){
$this->db->where('is_del=0');
$this->db->where('is_del=0')->where("bl_quota_starttime <= ".time())->where('bl_quota_endtime >= '.time())->where('bl_state=1');
}
if($limit){
$this->db->limit($limit[0],$limit[1]);
......
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