<?php
namespace app\api\controller\sharing;
use app\api\controller\Controller;
use app\api\model\sharing\Active as ActiveModel;
use app\api\model\sharing\Goods as GoodsModel;
class Active extends Controller
{
public function detail($active_id)
{
$detail = ActiveModel::detail($active_id);
if (!$detail) {
return $this->renderError('很抱歉,拼单不存在');
}
$model = new GoodsModel;
$goods = $model->getDetails($detail['goods_id'], $this->getUser(false));
$goodsList = $model->getList([], $this->getUser(false));
return $this->renderSuccess(compact('detail', 'goods', 'goodsList'));
}
}