|
|
|
|
@ -42,7 +42,7 @@ class VisitController extends CommonController
|
|
|
|
|
public function index()
|
|
|
|
|
{
|
|
|
|
|
$all = request()->all();
|
|
|
|
|
$list = Visit::with('visitTime', 'admin', 'visitArea', 'acceptAdmin.department', 'acceptAdminSignFile', 'acceptGoodsAdmin.department')->where(function ($query) use ($all) {
|
|
|
|
|
$list = Visit::with('visitTime', 'admin', 'visitArea', 'acceptAdmin.department', 'acceptAdminSignFile', 'acceptGoodsAdmin.department','audit.auditAdmin')->where(function ($query) use ($all) {
|
|
|
|
|
if (isset($all['keyword'])) {
|
|
|
|
|
$query->where('name', 'like', '%' . $all['keyword'] . '%');
|
|
|
|
|
}
|
|
|
|
|
@ -114,7 +114,7 @@ class VisitController extends CommonController
|
|
|
|
|
if ($validator->fails()) {
|
|
|
|
|
return $this->fail([ResponseCode::ERROR_PARAMETER, implode(',', $validator->errors()->all())]);
|
|
|
|
|
}
|
|
|
|
|
$detail = Visit::with('audit.auditAdmin', 'visitTime', 'acceptAdmin.department', 'acceptAdminSignFile', 'acceptGoodsAdmin.department', 'visitArea')->find($all['id']);
|
|
|
|
|
$detail = Visit::with('audit.auditAdmin', 'visitTime', 'acceptAdmin.department', 'acceptAdminSignFile', 'acceptGoodsAdmin.department', 'visitArea','audit.auditAdmin')->find($all['id']);
|
|
|
|
|
return $this->success($detail);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|