Commit 0ba6e599 by 杨树贤

案例详情接口

parent 9f96744d
......@@ -13,7 +13,7 @@ DB_PORT=3306
DB_DATABASE=lc_news
DB_USERNAME=root
DB_PASSWORD=root
DB_PREFIX=lc_
DB_PREFIX=lie_
BaseUrl=http://lc_server_news.cc
......
......@@ -20,8 +20,8 @@ class CaseController extends Controller
public function show(Request $request, CaseService $service)
{
$id = $request->get('art_id');
$case = $service->getCase($id);
$map = $request->only(['art_id','goods_id']);
$case = $service->getCase($map);
return $this->Export(0, 'ok', ['data' => $case]);
}
......
......@@ -69,7 +69,7 @@ class ArticleModel extends BaseModel
return compact('data','total');
}
public function getCase($id)
public function getCase($map)
{
$field = [
'art_id',
......@@ -98,7 +98,7 @@ class ArticleModel extends BaseModel
},
'article_addon',
])
->where('art_id', $id)
->where($map)
->first();
if (!empty($data)) {
$data = $data->toArray();
......
......@@ -38,10 +38,10 @@ class CaseService extends BaseService
return $data;
}
public function getCase($id)
public function getCase($map)
{
$model = new ArticleModel();
$case = $model->getCase($id);
$case = $model->getCase($map);
$case = $this->caseTransform($case);
return $case;
......@@ -72,6 +72,7 @@ class CaseService extends BaseService
$goodsInfo = $this->getGoodsInfo($item['goods_id']);
if ($goodsInfo) {
$item['goods_info'] = [
'goods_id' => $goodsInfo['goods_id'],
'goods_name' => $goodsInfo['goods_name'],
'goods_image' => is_array($goodsInfo['goods_images']) ? $goodsInfo['goods_images'][0] : $goodsInfo['goods_images'],
'ladder_price'=>$goodsInfo['ladder_price'],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment