getGoodsListByActiveTimeId($active_time_id); return $this->renderSuccess(compact('list')); } /** * 获取活动商品详情 * @param $active_time_id * @param $sharp_goods_id * @return array * @throws \think\exception\DbException */ public function detail($active_time_id, $sharp_goods_id) { // 获取秒杀活动商品详情 $service = new ActiveService; $data = $service->getyActiveGoodsDetail($active_time_id, $sharp_goods_id); if ($data === false) { return $this->renderError($service->getError()); } return $this->renderSuccess($data); } /** * 生成商品海报 * @param $active_time_id * @param $sharp_goods_id * @return array * @throws \app\common\exception\BaseException * @throws \think\exception\DbException */ public function poster($active_time_id, $sharp_goods_id) { // 获取秒杀活动商品详情 $service = new ActiveService; $data = $service->getyActiveGoodsDetail($active_time_id, $sharp_goods_id); if ($data === false) { return $this->renderError($service->getError()); } // 生成商品海报图 $Qrcode = new GoodsPoster($data['active'], $data['goods'], $this->getUser(false)); return $this->renderSuccess([ 'qrcode' => $Qrcode->getImage(), ]); } }