1234567891011121314151617181920212223242526272829303132333435 |
- <?php
- namespace App\Http\Controllers\admin;
- use App\Constants\HttpStatus;
- use App\Http\Controllers\Controller;
- use App\Services\IssueService;
- use Illuminate\Support\Facades\DB;
- use Illuminate\Validation\ValidationException;
- use Exception;
- class Issue extends Controller
- {
- /**
- * @description: 分页数据
- * @return {*}
- */
- function index()
- {
- try {
- request()->validate([
- 'issue_no' => ['nullable', 'string'],
- 'id' => ['nullable', 'string'],
- 'status' => ['nullable', 'string'],
- ]);
- $search = request()->all();
- $result = IssueService::paginate($search);
- } catch (ValidationException $e) {
- return $this->error(HttpStatus::VALIDATION_FAILED, $e->validator->errors()->first());
- } catch (Exception $e) {
- return $this->error(intval($e->getCode()));
- }
- return $this->success($result);
- }
- }
|