lyzflash
2025-11-17 91a56a9b83ec23a1580aa586a24b34aba6990ffa
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
49
50
51
52
53
54
55
<?php
 
namespace app\api\controller\plus\assemble;
 
use app\api\controller\Controller;
use app\api\model\plus\assemble\Product as ProductModel;
use app\api\model\plus\assemble\Active as ActiveModel;
use app\api\model\settings\Setting as SettingModel;
use app\common\service\product\BaseProductService;
use app\api\model\plus\assemble\Bill as BillModel;
/**
 * 拼团控制器
 */
class Product extends Controller
{
    /**
     * 拼团活动
     */
    public function active()
    {
        $model = new ActiveModel();
        $list = $model->activityList();
        return $this->renderSuccess('', compact('list'));
    }
 
    /**
     * 拼团商品
     */
    public function product($assemble_activity_id)
    {
        $detail = ActiveModel::detailWithTrans($assemble_activity_id);
        $list = (new ProductModel())->getActivityList($assemble_activity_id);
        return $this->renderSuccess('', compact('detail','list'));
    }
 
    /**
     * 拼团商品详情
     */
    public function detail($assemble_product_id)
    {
        $model = new ProductModel();
        //详情
        $detail = $model->getAssembleDetail($assemble_product_id);
        //活动
        $active = ActiveModel::detailWithTrans($detail['assemble_activity_id']);
        //规格
        $specData = BaseProductService::getSpecData($detail['product']);
        //拼团订单
        $model = new BillModel();
        $bill = $model->getBill($detail['assemble_product_id'], $detail['assemble_activity_id'], $detail['assemble_num']);
        //是否显示店铺信息
        $store_open = SettingModel::getStoreOpen();
        return $this->renderSuccess('', compact('detail', 'active', 'specData', 'bill', 'store_open'));
    }
}