This commit is contained in:
wangxiaowei 2024-11-28 17:13:57 +08:00
commit 2e4e8fd23c
4 changed files with 17 additions and 14 deletions

@ -4,7 +4,6 @@ namespace app\admin\controller\groupbuy;
use app\common\basics\AdminBase;
use app\common\model\groupbuy\GroupbuyConfig;
use app\common\server\JsonServer;
use app\admin\logic\groupbuy\GroupbuyLogic;
use app\admin\validate\groupbuy\GroupbuyValidate;

@ -42,6 +42,7 @@ class GroupbuyLogic extends Logic
'var_page' => 'page'
])
->toArray();
if($lists){
foreach ($lists['data'] as &$item){
$item['goods_image'] = UrlServer::getFileUrl($item['goods_image']);
@ -50,8 +51,6 @@ class GroupbuyLogic extends Logic
}
return ['count'=>$lists['total'], 'lists'=>$lists['data']];
}
public static function add($post){

@ -8,7 +8,7 @@ use app\common\server\JsonServer;
class GroupBuyGoods extends Api
{
public $like_not_need_login = ['getGroupBuyGoods',];
public $like_not_need_login = ['getGroupBuyGoods'];
/**
* @return void
@ -23,7 +23,6 @@ class GroupBuyGoods extends Api
$data = GroupBuyLogic::getGroupBuyGoods($get);
return JsonServer::success('', $data);
}
}

@ -5,6 +5,7 @@ namespace app\api\logic;
use app\common\basics\Logic;
use app\common\model\groupbuy\GroupbuyGoods;
use app\common\server\UrlServer;
use app\common\model\groupbuy\GroupbuyConfig;
class GroupBuyLogic extends Logic
{
@ -42,23 +43,28 @@ class GroupBuyLogic extends Logic
foreach($lists as &$item) {
// 图片加域名
$item['goods_image'] = UrlServer::getFileUrl($item['goods_image']);
}
$lists = [];
$data = GroupbuyConfig::select();
$config = array();
if (!empty($data)) {
$result = $data->toArray();
foreach ($result as &$v) {
if ($v['name'] == 'service') {
$v['value'] = explode(',', $v['value']);
}
$config[$v['name']] = $v['value'];
}
}
return [
'count' => $count,
'lists' => $lists,
'page_no' => $get['page_no'],
'page_size' => $get['page_size'],
'more' => is_more($count, $get['page_no'], $get['page_size']),
'rule'=>'抢购规则:<br/>
1、抢购活动时间:10月1号至10月7号;<br/>
2、抢购场次:活动期内每天上午12点及晚上8点各一场,抢完即止;<br/>
3、抢购权限:活动期间内每人及每个身份证只能抢购一次;<br/>
4、确认抢购成功条件:以付款成功为确认抢购成功;抢购成功后5分钟内不支付款项的,则视为放弃。<br/>
5、抢购活动产生的订单也参与平台消费返补活动;<br/>
6、所有抢购成功并支付款项的,对应抢购商品统一于节后全部发出,运费自付!<br/>
7、抢购商品,非质量问题,不接受退货!'
'config' => $config,
];
}