-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ab1f089
commit 5c67653
Showing
188 changed files
with
6,116 additions
and
410 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers\Backend\Product; | ||
|
||
use App\Http\Controllers\PlatformController; | ||
|
||
class VipController extends PlatformController | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
83 changes: 83 additions & 0 deletions
83
app/Http/Controllers/Backend/System/SystemComplaintController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers\Backend\System; | ||
use App\Models\System\SystemComplaint; | ||
use Illuminate\Http\Request; | ||
use App\Http\Controllers\PlatformController; | ||
|
||
class SystemComplaintController extends PlatformController | ||
{ | ||
protected $controller_event_text = "系统投诉"; | ||
|
||
/** | ||
* @param Request $request | ||
* @return \Illuminate\Http\JsonResponse | ||
*/ | ||
public function index(Request $request){ | ||
$res = (new SystemComplaint())->searchBuild($request->all())->paginate(); | ||
return self::successJsonResponse($res); | ||
} | ||
|
||
/** | ||
* @param Request $request | ||
* @return \Illuminate\Http\JsonResponse | ||
*/ | ||
public function view(Request $request){ | ||
if ($request->isMethod('POST') && $id = $request->input('id')) { | ||
if ($model = SystemComplaint::findOneByID($id)) { | ||
return self::successJsonResponse($model); | ||
} | ||
} | ||
|
||
return self::failJsonResponse(); | ||
} | ||
|
||
/** | ||
* @param Request $request | ||
* @return \Illuminate\Http\JsonResponse | ||
*/ | ||
public function save(Request $request){ | ||
if ($request->isMethod('POST')) { | ||
$id = $request->input('id'); | ||
|
||
try { | ||
$this->validate($request, [ | ||
'title' => 'required|min:1', | ||
'content' => 'required|min:1', | ||
'type' => 'required|min:1', | ||
'status' => 'required|min:1', | ||
]); | ||
|
||
if ($id > 0) { | ||
$model = SystemComplaint::findOneByID($id); | ||
} else { | ||
$model = new SystemComplaint(); | ||
} | ||
|
||
if ($model->fill($request->all())->save()) { | ||
$this->saveEvent($model->title); | ||
return self::successJsonResponse(); | ||
} | ||
} catch (\Exception $e) { | ||
return self::failJsonResponse($e->getMessage()); | ||
} | ||
} | ||
return self::failJsonResponse(); | ||
} | ||
|
||
/** | ||
* @param Request $request | ||
* @return \Illuminate\Http\JsonResponse | ||
*/ | ||
public function delete(Request $request){ | ||
if ($id = $request->input('id')) { | ||
if ($model = SystemComplaint::findOneByID($id)) { | ||
$this->deleteEvent($model->title); | ||
$model->delete(); | ||
return self::successJsonResponse(); | ||
} | ||
} | ||
|
||
return self::failJsonResponse(); | ||
} | ||
} |
Oops, something went wrong.