|
|
@@ -18,7 +18,7 @@ use App\Services\ConfigService;
|
|
|
class Config extends Controller
|
|
|
{
|
|
|
|
|
|
- /**
|
|
|
+ /** 设置配置
|
|
|
*/
|
|
|
public function setField()
|
|
|
{
|
|
|
@@ -98,6 +98,34 @@ class Config extends Controller
|
|
|
return $this->success($result);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @api {get} /admin/config/gameList 彩票配置
|
|
|
+ */
|
|
|
+ public function gameList(): JsonResponse
|
|
|
+ {
|
|
|
+ try {
|
|
|
+ $search['group_id'] = 5;
|
|
|
+ $list = ConfigModel::where('group_id', $search['group_id'])->where('field', 'game_list')->value('val');
|
|
|
+ $list = $list ? json_decode($list, true) : [];
|
|
|
+ $data = [];
|
|
|
+ $i = count($list);
|
|
|
+ foreach($list as $v) {
|
|
|
+ $i--;
|
|
|
+ if ($v['status'] == 1) {
|
|
|
+ $data[$v['sort'].$i] = $v;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ krsort($data);
|
|
|
+ $data = array_values($data);
|
|
|
+ } 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($data);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 分页数据
|
|
|
*
|