|
@@ -90,4 +90,59 @@ class SettingsController extends Controller
|
|
return $this->showWarning("操作失败");
|
|
return $this->showWarning("操作失败");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+// 参数设置
|
|
|
|
+ public function paihangEdit(Request $reqeust) {
|
|
|
|
+ if ($reqeust->method() == 'POST') {
|
|
|
|
+ $data = (array) request('data');
|
|
|
|
+ $result = BaseSettingsModel::where('category','paihang')->get();
|
|
|
|
+ if (count($result) == 0) {
|
|
|
|
+ $data['category'] = 'paihang';
|
|
|
|
+ $data['sort'] = 0;
|
|
|
|
+ $data['pid'] = 0;
|
|
|
|
+ $ok = BaseSettingsModel::create($data);
|
|
|
|
+ if ($ok) {
|
|
|
|
+ return $this->showMessage('操作成功');
|
|
|
|
+ }else{
|
|
|
|
+ return $this->showWarning('操作失败');
|
|
|
|
+ }
|
|
|
|
+ }else {
|
|
|
|
+ $ok = BaseSettingsModel::where('category', 'paihang')->update($data);
|
|
|
|
+ if ($ok) {
|
|
|
|
+ return $this->showMessage('操作成功');
|
|
|
|
+ } else {
|
|
|
|
+ return $this->showWarning('操作失败');
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ $data = BaseSettingsModel::where('category','paihang')->first();
|
|
|
|
+ return view('admin.settings.paihang.edit',compact('data'));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public function scoreEdit(Request $reqeust) {
|
|
|
|
+ if ($reqeust->method() == 'POST') {
|
|
|
|
+ $data = (array) request('data');
|
|
|
|
+ $result = BaseSettingsModel::where('category','score')->get();
|
|
|
|
+ if (count($result) == 0) {
|
|
|
|
+ $data['category'] = 'score';
|
|
|
|
+ $data['sort'] = 0;
|
|
|
|
+ $data['pid'] = 0;
|
|
|
|
+ $ok = BaseSettingsModel::create($data);
|
|
|
|
+ if ($ok) {
|
|
|
|
+ return $this->showMessage('操作成功');
|
|
|
|
+ }else{
|
|
|
|
+ return $this->showWarning('操作失败');
|
|
|
|
+ }
|
|
|
|
+ }else {
|
|
|
|
+ $ok = BaseSettingsModel::where('category', 'score')->update($data);
|
|
|
|
+ if ($ok) {
|
|
|
|
+ return $this->showMessage('操作成功');
|
|
|
|
+ } else {
|
|
|
|
+ return $this->showWarning('操作失败');
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ $data = BaseSettingsModel::where('category','score')->first();
|
|
|
|
+ return view('admin.settings.score.edit',compact('data'));
|
|
|
|
+ }
|
|
}
|
|
}
|