|
|
|
|
@ -39,7 +39,7 @@ class VisitController extends CommonController
|
|
|
|
|
public function index()
|
|
|
|
|
{
|
|
|
|
|
$all = request()->all();
|
|
|
|
|
$list = Visit::with('visitTime')->where(function ($query) use ($all) {
|
|
|
|
|
$list = Visit::with('visitTime', 'admin')->where(function ($query) use ($all) {
|
|
|
|
|
if (isset($all['keyword'])) {
|
|
|
|
|
$query->where('name', 'like', '%' . $all['keyword'] . '%');
|
|
|
|
|
}
|
|
|
|
|
@ -164,7 +164,7 @@ class VisitController extends CommonController
|
|
|
|
|
$model = new Visit();
|
|
|
|
|
$all['admin_id'] = $this->getUserId();
|
|
|
|
|
$all['department_id'] = $this->getUser()->department_id;
|
|
|
|
|
$all['code'] = randStr(6,true);
|
|
|
|
|
$all['code'] = randStr(6, true);
|
|
|
|
|
}
|
|
|
|
|
$model->fill($all);
|
|
|
|
|
$model->save();
|
|
|
|
|
|