quanwei
2025-11-21 1db9a4130699636cabe7e0c9f7f15d004aadada0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
 
namespace app\api\controller\plus\seckill;
 
use app\api\controller\Controller;
use app\api\model\plus\seckill\Product as ProductModel;
use app\api\model\plus\seckill\Active as ActiveModel;
use app\api\model\settings\Setting as SettingModel;
use app\common\service\product\BaseProductService;
 
/**
 * 秒杀产品控制器
 */
class Product extends Controller
{
    /**
     * 秒杀活动
     */
    public function active()
    {
        $model = new ActiveModel();
        $list = $model->activityList();
        return $this->renderSuccess('', compact('list'));
    }
    /**
     * 秒杀商品
     */
    public function product($seckill_activity_id)
    {
        $detail = ActiveModel::detailWithTrans($seckill_activity_id);
        $list = (new ProductModel())->getActivityList($seckill_activity_id);
        return $this->renderSuccess('', compact('detail','list'));
    }
    /**
     * 秒杀商品详情
     */
    public function detail($seckill_product_id)
    {
        $model = new ProductModel();
        $detail = $model->getSeckillDetail($seckill_product_id);
        $active = ActiveModel::detailWithTrans($detail['seckill_activity_id']);
        $specData = BaseProductService::getSpecData($detail['product']);
        //是否显示店铺信息
        $store_open = SettingModel::getStoreOpen();
        return $this->renderSuccess('', compact('detail', 'active', 'specData', 'store_open'));
    }
 
}