正在显示
3 个修改的文件
包含
128 行增加
和
0 行删除
| 1 | +<?php | ||
| 2 | + | ||
| 3 | +namespace App\Http\Controllers\Aside\WorkOrder; | ||
| 4 | + | ||
| 5 | +use App\Enums\Common\Code; | ||
| 6 | +use App\Http\Controllers\Aside\BaseController; | ||
| 7 | +use App\Http\Controllers\Controller; | ||
| 8 | +use App\Http\Requests\Aside\WorkOrder\TicketProjectUpdateRequest; | ||
| 9 | +use App\Models\WorkOrder\TicketProject; | ||
| 10 | +use Illuminate\Http\Request; | ||
| 11 | + | ||
| 12 | +class TicketProjectController extends BaseController | ||
| 13 | +{ | ||
| 14 | + /** | ||
| 15 | + * Display a listing of the resource. | ||
| 16 | + * | ||
| 17 | + * @return \Illuminate\Http\Response | ||
| 18 | + */ | ||
| 19 | + public function index() | ||
| 20 | + { | ||
| 21 | + // | ||
| 22 | + } | ||
| 23 | + | ||
| 24 | + /** | ||
| 25 | + * Show the form for creating a new resource. | ||
| 26 | + * | ||
| 27 | + * @return \Illuminate\Http\Response | ||
| 28 | + */ | ||
| 29 | + public function create() | ||
| 30 | + { | ||
| 31 | + // | ||
| 32 | + } | ||
| 33 | + | ||
| 34 | + /** | ||
| 35 | + * Store a newly created resource in storage. | ||
| 36 | + * | ||
| 37 | + * @param \Illuminate\Http\Request $request | ||
| 38 | + * @return \Illuminate\Http\Response | ||
| 39 | + */ | ||
| 40 | + public function store(Request $request) | ||
| 41 | + { | ||
| 42 | + // | ||
| 43 | + } | ||
| 44 | + | ||
| 45 | + /** | ||
| 46 | + * Display the specified resource. | ||
| 47 | + * | ||
| 48 | + * @param int $id | ||
| 49 | + * @return \Illuminate\Http\Response | ||
| 50 | + */ | ||
| 51 | + public function show($id) | ||
| 52 | + { | ||
| 53 | + // | ||
| 54 | + } | ||
| 55 | + | ||
| 56 | + /** | ||
| 57 | + * Show the form for editing the specified resource. | ||
| 58 | + * | ||
| 59 | + * @param int $id | ||
| 60 | + * @return \Illuminate\Http\Response | ||
| 61 | + */ | ||
| 62 | + public function edit($id) | ||
| 63 | + { | ||
| 64 | + // | ||
| 65 | + } | ||
| 66 | + | ||
| 67 | + /** | ||
| 68 | + * Update the specified resource in storage. | ||
| 69 | + * | ||
| 70 | + * @param \Illuminate\Http\Request $request | ||
| 71 | + * @param int $id | ||
| 72 | + * @return \Illuminate\Http\Response | ||
| 73 | + */ | ||
| 74 | + public function update(TicketProjectUpdateRequest $request, $id) | ||
| 75 | + { | ||
| 76 | + $request->validated(); | ||
| 77 | + $project = TicketProject::where('uuid', $id)->first(); | ||
| 78 | + if (!$project) $this->response('Project not found', Code::USER_MODEL_NOTFOUND_ERROE); | ||
| 79 | + | ||
| 80 | + if ($request->input('subtitle')) $project->subtitle = $request->input('subtitle'); | ||
| 81 | + $project->wechat_switch = $request->boolean('wechat_switch', true); | ||
| 82 | + $project->save(); | ||
| 83 | + $this->response('Project updated successfully', Code::SUCCESS, $project); | ||
| 84 | + } | ||
| 85 | + | ||
| 86 | + /** | ||
| 87 | + * Remove the specified resource from storage. | ||
| 88 | + * | ||
| 89 | + * @param int $id | ||
| 90 | + * @return \Illuminate\Http\Response | ||
| 91 | + */ | ||
| 92 | + public function destroy($id) | ||
| 93 | + { | ||
| 94 | + // | ||
| 95 | + } | ||
| 96 | +} |
| 1 | +<?php | ||
| 2 | + | ||
| 3 | +namespace App\Http\Requests\Aside\WorkOrder; | ||
| 4 | + | ||
| 5 | +use Illuminate\Foundation\Http\FormRequest; | ||
| 6 | + | ||
| 7 | +class TicketProjectUpdateRequest extends FormRequest | ||
| 8 | +{ | ||
| 9 | + /** | ||
| 10 | + * Determine if the user is authorized to make this request. | ||
| 11 | + * | ||
| 12 | + * @return bool | ||
| 13 | + */ | ||
| 14 | + public function authorize() | ||
| 15 | + { | ||
| 16 | + return true; | ||
| 17 | + } | ||
| 18 | + | ||
| 19 | + /** | ||
| 20 | + * Get the validation rules that apply to the request. | ||
| 21 | + * | ||
| 22 | + * @return array | ||
| 23 | + */ | ||
| 24 | + public function rules() | ||
| 25 | + { | ||
| 26 | + return [ | ||
| 27 | + 'subtitle' => 'nullable|string', | ||
| 28 | + 'wechat_switch' => 'nullable|boolean', | ||
| 29 | + ]; | ||
| 30 | + } | ||
| 31 | +} |
| @@ -257,6 +257,7 @@ Route::middleware(['aloginauth'])->group(function () { | @@ -257,6 +257,7 @@ Route::middleware(['aloginauth'])->group(function () { | ||
| 257 | Route::post('/{id}', [Aside\WorkOrder\AsideTicketController::class, 'update'])->name('admin.tickets.update')->summary('A端更新工单,审核,邀请同事'); | 257 | Route::post('/{id}', [Aside\WorkOrder\AsideTicketController::class, 'update'])->name('admin.tickets.update')->summary('A端更新工单,审核,邀请同事'); |
| 258 | Route::get('/pushNotify/{id}', [Aside\WorkOrder\AsideTicketController::class, 'pushNotify'])->name('admin.tickets.pushNotify')->summary('A端工单推送企微群'); | 258 | Route::get('/pushNotify/{id}', [Aside\WorkOrder\AsideTicketController::class, 'pushNotify'])->name('admin.tickets.pushNotify')->summary('A端工单推送企微群'); |
| 259 | Route::get('/projects/{search}', [Aside\WorkOrder\AsideTicketController::class, 'getProjects'])->name('admin.tickets.projects')->summary('A端V5V6项目列表'); | 259 | Route::get('/projects/{search}', [Aside\WorkOrder\AsideTicketController::class, 'getProjects'])->name('admin.tickets.projects')->summary('A端V5V6项目列表'); |
| 260 | + Route::patch('/projects/{id}', [Aside\WorkOrder\TicketProjectController::class, 'update'])->name('admin.tickets.projects.update')->summary('A端修改工单项目'); | ||
| 260 | Route::get('/v56_projects/list', [Aside\WorkOrder\AsideTicketController::class, 'projectList'])->name('admin.tickets.projectList')->summary('A端V5V6项目列表') | 261 | Route::get('/v56_projects/list', [Aside\WorkOrder\AsideTicketController::class, 'projectList'])->name('admin.tickets.projectList')->summary('A端V5V6项目列表') |
| 261 | ->description("project_cate[项目分类1]: 1 V5, 2 V6, 3 超迹, 4 域途"); | 262 | ->description("project_cate[项目分类1]: 1 V5, 2 V6, 3 超迹, 4 域途"); |
| 262 | Route::post('/log/{id}', [Aside\WorkOrder\AsideTicketLogController::class, 'update'])->name('admin.tickets.log.update')->summary('A端工单操作日志更新,完成工单'); | 263 | Route::post('/log/{id}', [Aside\WorkOrder\AsideTicketLogController::class, 'update'])->name('admin.tickets.log.update')->summary('A端工单操作日志更新,完成工单'); |
-
请 注册 或 登录 后发表评论