$params['name'], 'url' => $params['url'], 'app_id' => create_app_id(), 'app_key' => create_app_key(), 'status' => 0, ]); return true; }catch (\Exception $e) { self::setError($e->getMessage()); return false; } } //删除 public static function delete(array $params): bool { try { System::update([ 'id' => $params['id'], 'status' => 2, 'update_time' => time() ]); return true; } catch (\Exception $e) { self::setError($e->getMessage()); return false; } } //修改 public static function edit(array $params) : bool { try { System::update([ 'id' => $params['id'], 'name' => $params['name'], 'url' => $params['url'], 'status' => $params['status'], 'update_time' => time() ]); return true; } catch (\Exception $e) { self::setError($e->getMessage()); return false; } } // 查看 public static function detail($params) : array { $data = System::field('id,name,app_id,app_key,url,status,create_time')->findOrEmpty($params['id']); $data['status_text'] = $data->status_text; return $data->toArray(); } }