first(); if(!$obj) { $obj = new \App\Models\Config(); $obj->key = "box_hit_cnt"; } $obj->val = (int)$input['hit_cnt']; $obj->save(); // return $this ->response() ->success('修改成功') ->refresh(); } /** * Build a form here. */ public function form() { // $this->number("hit_cnt", "保底次数")->required()->help("到保底次数前还未抽中SSR,则下次必中"); // } /** * The data of the form. * * @return array */ public function default() { // return (new \App\Http\Controllers\BoxController())->getBoxHit(); // $obj = \App\Models\Config::where("key", "box_hit_cnt")->first(); // if ($obj && $obj->val) { // return ['hit_cnt'=>(int)$obj->val]; // } // // // return config("avatar.box_hit_cnt"); } }