diff --git a/app/api/logic/LocalStoreGoodsLogic.php b/app/api/logic/LocalStoreGoodsLogic.php index 6f1f8075..46c1b94b 100644 --- a/app/api/logic/LocalStoreGoodsLogic.php +++ b/app/api/logic/LocalStoreGoodsLogic.php @@ -3,7 +3,6 @@ namespace app\api\logic; use app\common\basics\Logic; -use app\common\model\LocalStore; use app\common\model\localstore\LocalStoreGoods; use app\common\model\localstore\LocalStoreGoodsPic; use app\common\model\localstore\LocalStoreGoodsItem; @@ -19,6 +18,9 @@ class LocalStoreGoodsLogic extends Logic // 88折 public static $sale = 88 / 100; + // 88折商家ID + public static $lstore_id = 138; + // 获取商品列表 public static function lists($get) { @@ -62,6 +64,13 @@ class LocalStoreGoodsLogic extends Logic ->select() ->toArray(); + if ($get['lstore_id'] == Config::get('localstore.dlh_lstore_id')) { + foreach ($list as $k => &$v) { + $list[$k]['original_price'] = $v['price']; + $v['price'] = number_format($v['price'] * self::$sale, 2, '.', ''); + } + } + $count = LocalStoreGoods::where($where)->where($m_where)->count(); // 统计待审核的商品数量 @@ -252,12 +261,12 @@ class LocalStoreGoodsLogic extends Logic ])->find()->toArray(); // 东龙汇超时价格 *88折 - if ($get['lstore_id'] == 138) { + if ($get['lstore_id'] == Config::get('localstore.dlh_lstore_id')) { $data['original_price'] = $data['price']; $data['price'] = number_format($data['price'] * self::$sale, 2, '.', ''); } - if ($get['lstore_id'] != 138) { + if ($get['lstore_id'] != Config::get('localstore.dlh_lstore_id')) { $data['close'] = array( 'status' => ConfigServer::get('website', 'show_local_notice'), 'text' => ConfigServer::get('website', 'local_notice') @@ -274,7 +283,7 @@ class LocalStoreGoodsLogic extends Logic $v['image'] = Config::get('aliyunoss.domain') . $v['image']; // 东龙汇超时价格 *88折 - if ($get['lstore_id'] == 138) { + if ($get['lstore_id'] == Config::get('localstore.dlh_lstore_id')) { $v['original_price'] = $v['price']; $v['price'] = number_format($v['price'] * self::$sale, 2, '.', ''); } diff --git a/app/api/logic/LocalStoreLogic.php b/app/api/logic/LocalStoreLogic.php index e21cc563..fc39803a 100644 --- a/app/api/logic/LocalStoreLogic.php +++ b/app/api/logic/LocalStoreLogic.php @@ -159,7 +159,7 @@ class LocalStoreLogic extends Logic foreach ($lists as $key => &$value) { // 东龙汇超时价格 *88折 - if ($value['lstore_id'] == 138) { + if ($value['lstore_id'] == Config::get('localstore.dlh_lstore_id')) { $lists[$key]['original_price'] = $value['price']; $lists[$key]['price'] = round($value['price'] * LocalStoreGoodsLogic::$sale, 2); } @@ -238,7 +238,7 @@ class LocalStoreLogic extends Logic foreach ($lists as $key => &$value) { // 东龙汇超时价格 *88折 - if ($value['lstore_id'] == 138) { + if ($value['lstore_id'] == Config::get('localstore.dlh_lstore_id')) { foreach ($value['street_goods'] as $k1 => &$v1) { $value['street_goods'][$k1]['original_price'] = $v1['price']; $v1['price'] = round($v1['price'] * LocalStoreGoodsLogic::$sale, 2); @@ -388,7 +388,7 @@ class LocalStoreLogic extends Logic $data['goods_total_price'] = round($goods_msg['price'] * $post['goods_num'], 2); } - if ($post['lstore_id'] == 138) { + if ($post['lstore_id'] == Config::get('localstore.dlh_lstore_id')) { $data['goods_total_price'] = number_format($data['goods_total_price'] * LocalStoreGoodsLogic::$sale, 2, '.', ''); } diff --git a/config/localstore.php b/config/localstore.php new file mode 100755 index 00000000..d18988d8 --- /dev/null +++ b/config/localstore.php @@ -0,0 +1,5 @@ + 138 // 东龙汇优选超市 +]; \ No newline at end of file