|
@@ -51,6 +51,8 @@ abstract class AdminBaseController extends BaseController
|
|
|
|
|
|
protected $service = null;
|
|
|
|
|
|
+ protected $with = [];
|
|
|
+
|
|
|
/**
|
|
|
* 初始化
|
|
|
*/
|
|
@@ -76,7 +78,7 @@ abstract class AdminBaseController extends BaseController
|
|
|
}
|
|
|
$where = $this->request->getMore($this->searchable, false, $this->searchDeal);
|
|
|
list($page, $limit) = $this->service->getPageValue();
|
|
|
- $list = $this->service->getList($where, '*', $page, $limit);
|
|
|
+ $list = $this->service->getList($where, '*', $page, $limit, $this->with);
|
|
|
$count = $this->service->getCount($where);
|
|
|
return $this->success(compact('list', 'count'));
|
|
|
}
|
|
@@ -87,7 +89,7 @@ abstract class AdminBaseController extends BaseController
|
|
|
if (!$this->service) {
|
|
|
throw new AdminException('接口不存在');
|
|
|
}
|
|
|
- $info = $this->service->get($id);
|
|
|
+ $info = $this->service->get($id, '*', $this->with);
|
|
|
if (!$info)
|
|
|
return $this->error('数据不存在');
|
|
|
return $this->success('ok', $info->toArray());
|