master
cody 5 months ago
parent 69ddba6278
commit 63fef77b9a

@ -56,7 +56,7 @@ class EmailRecordController extends BaseController
public function index() public function index()
{ {
$all = request()->all(); $all = request()->all();
$list = $this->model->with('emailRecordUsers.user')->where(function ($query) use ($all) { $list = $this->model->with('emailRecordUsers')->where(function ($query) use ($all) {
if (isset($all['filter']) && !empty($all['filter'])) { if (isset($all['filter']) && !empty($all['filter'])) {
foreach ($all['filter'] as $condition) { foreach ($all['filter'] as $condition) {
$key = $condition['key'] ?? null; $key = $condition['key'] ?? null;
@ -149,7 +149,7 @@ class EmailRecordController extends BaseController
if ($validator->fails()) { if ($validator->fails()) {
return $this->fail([ResponseCode::ERROR_PARAMETER, implode(',', $validator->errors()->all())]); return $this->fail([ResponseCode::ERROR_PARAMETER, implode(',', $validator->errors()->all())]);
} }
$detail = $this->model->with('emailRecordUsers.user')->find($all['id']); $detail = $this->model->with('emailRecordUsers')->find($all['id']);
return $this->success($detail); return $this->success($detail);
} }

Loading…
Cancel
Save