From 2a97c21c0cc16d3a6b2dce9620897751be80dc82 Mon Sep 17 00:00:00 2001 From: Henry Date: Thu, 17 Feb 2022 14:54:57 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E5=9F=BA=E4=BA=8EPHP7.1=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E4=BD=BF=E7=94=A8Catch=E5=A4=9A=E4=B8=AA=E8=AF=AD=E5=8F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/library/traits/Backend.php | 36 ++++---------------- 1 file changed, 6 insertions(+), 30 deletions(-) diff --git a/application/admin/library/traits/Backend.php b/application/admin/library/traits/Backend.php index f81f62fee..37b730855 100755 --- a/application/admin/library/traits/Backend.php +++ b/application/admin/library/traits/Backend.php @@ -110,13 +110,7 @@ trait Backend } $result = $this->model->allowField(true)->save($params); Db::commit(); - } catch (ValidateException $e) { - Db::rollback(); - $this->error($e->getMessage()); - } catch (PDOException $e) { - Db::rollback(); - $this->error($e->getMessage()); - } catch (Exception $e) { + } catch (ValidateException|PDOException|Exception $e) { Db::rollback(); $this->error($e->getMessage()); } @@ -161,13 +155,7 @@ trait Backend } $result = $row->allowField(true)->save($params); Db::commit(); - } catch (ValidateException $e) { - Db::rollback(); - $this->error($e->getMessage()); - } catch (PDOException $e) { - Db::rollback(); - $this->error($e->getMessage()); - } catch (Exception $e) { + } catch (ValidateException|PDOException|Exception $e) { Db::rollback(); $this->error($e->getMessage()); } @@ -207,10 +195,7 @@ trait Backend $count += $v->delete(); } Db::commit(); - } catch (PDOException $e) { - Db::rollback(); - $this->error($e->getMessage()); - } catch (Exception $e) { + } catch (PDOException|Exception $e) { Db::rollback(); $this->error($e->getMessage()); } @@ -248,10 +233,7 @@ trait Backend $count += $v->delete(true); } Db::commit(); - } catch (PDOException $e) { - Db::rollback(); - $this->error($e->getMessage()); - } catch (Exception $e) { + } catch (PDOException|Exception $e) { Db::rollback(); $this->error($e->getMessage()); } @@ -288,10 +270,7 @@ trait Backend $count += $item->restore(); } Db::commit(); - } catch (PDOException $e) { - Db::rollback(); - $this->error($e->getMessage()); - } catch (Exception $e) { + } catch (PDOException|Exception $e) { Db::rollback(); $this->error($e->getMessage()); } @@ -327,10 +306,7 @@ trait Backend $count += $item->allowField(true)->isUpdate(true)->save($values); } Db::commit(); - } catch (PDOException $e) { - Db::rollback(); - $this->error($e->getMessage()); - } catch (Exception $e) { + } catch (PDOException|Exception $e) { Db::rollback(); $this->error($e->getMessage()); } -- Gitee From ff51380686b68b56fc3847e0ccc1fe6af4b93c36 Mon Sep 17 00:00:00 2001 From: "aa820t@126.com" Date: Wed, 30 Mar 2022 08:21:20 +0000 Subject: [PATCH 2/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20think=20=E6=A1=86?= =?UTF-8?q?=E6=9E=B6=E5=BC=95=E5=AF=BC=E6=96=87=E4=BB=B6=20=E4=B8=BA?= =?UTF-8?q?=E7=BB=9D=E5=AF=B9=E8=B7=AF=E5=BE=84=20=E5=9C=A8=E9=9D=9E?= =?UTF-8?q?=E6=9C=AC=E9=A1=B9=E7=9B=AE=E6=A0=B9=E7=9B=AE=E5=BD=95=E4=B8=8B?= =?UTF-8?q?,=20=E6=89=A7=E8=A1=8Cphp=20think=20=E5=91=BD=E4=BB=A4=E8=A1=8C?= =?UTF-8?q?,=20=E4=BD=BF=E7=94=A8=E5=BC=95=E7=94=A8=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E4=BC=9A=E5=AF=BC=E8=87=B4=E5=90=8E=E7=BB=AD=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E6=89=A7=E8=A1=8C.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- think | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/think b/think index 8afa938af..8eeb81b57 100755 --- a/think +++ b/think @@ -14,4 +14,4 @@ define('APP_PATH', __DIR__ . '/application/'); // 加载框架引导文件 -require './thinkphp/console.php'; \ No newline at end of file +require __DIR__ . '/thinkphp/console.php'; \ No newline at end of file -- Gitee From e67f9a20c54b0a67a0290ced7ee18c03a9a7d63c Mon Sep 17 00:00:00 2001 From: F4nniu Date: Thu, 31 Mar 2022 23:28:16 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=89=8B=E6=9C=BA?= =?UTF-8?q?=E9=AA=8C=E8=AF=81=E7=A0=81=E4=B8=8D=E6=94=AF=E6=8C=81=200=20?= =?UTF-8?q?=E5=BC=80=E5=A4=B4=E7=9A=84=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/index/view/user/profile.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/index/view/user/profile.html b/application/index/view/user/profile.html index 62e6b05ba..43a171680 100644 --- a/application/index/view/user/profile.html +++ b/application/index/view/user/profile.html @@ -155,7 +155,7 @@
- + 获取验证码 -- Gitee From a4617c7f286cfb60f5ecd63ad27d07d2b2702125 Mon Sep 17 00:00:00 2001 From: F4nniu Date: Fri, 1 Apr 2022 09:58:43 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=AA=8C=E8=AF=81?= =?UTF-8?q?=E7=A0=81=E4=B8=8D=E6=94=AF=E6=8C=81=200=20=E5=BC=80=E5=A4=B4?= =?UTF-8?q?=E7=9A=84=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/index/view/common/captcha.html | 4 ++-- application/index/view/user/login.html | 2 +- application/index/view/user/profile.html | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/application/index/view/common/captcha.html b/application/index/view/common/captcha.html index 8db2df913..d424e70fc 100644 --- a/application/index/view/common/captcha.html +++ b/application/index/view/common/captcha.html @@ -1,11 +1,11 @@ {if "[type]" == 'email'} - + 发送验证码 {elseif "[type]" == 'mobile'/} - + 发送验证码 diff --git a/application/index/view/user/login.html b/application/index/view/user/login.html index eb3ecfb7d..f75237b83 100755 --- a/application/index/view/user/login.html +++ b/application/index/view/user/login.html @@ -69,7 +69,7 @@
- + {:__('Send verification code')} diff --git a/application/index/view/user/profile.html b/application/index/view/user/profile.html index 43a171680..e0b57b370 100644 --- a/application/index/view/user/profile.html +++ b/application/index/view/user/profile.html @@ -121,7 +121,7 @@
- + 获取验证码 -- Gitee From 036c2dcc25c588aa86d1bc94eceb2bdc5f67bfd5 Mon Sep 17 00:00:00 2001 From: qhyan Date: Tue, 19 Apr 2022 20:29:47 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=AF=B4=E6=98=8E?= =?UTF-8?q?=E4=B8=8D=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/lang/zh-cn/user.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/api/lang/zh-cn/user.php b/application/api/lang/zh-cn/user.php index eb40897fd..e98e4cd05 100644 --- a/application/api/lang/zh-cn/user.php +++ b/application/api/lang/zh-cn/user.php @@ -7,7 +7,7 @@ return [ 'Sign up successful' => '注册成功', 'Username can not be empty' => '用户名不能为空', 'Username must be 3 to 30 characters' => '用户名必须3-30个字符', - 'Username must be 6 to 30 characters' => '用户名必须3-30个字符', + 'Username must be 6 to 30 characters' => '用户名必须6-30个字符', 'Password can not be empty' => '密码不能为空', 'Password must be 6 to 30 characters' => '密码必须6-30个字符', 'Mobile is incorrect' => '手机格式不正确', -- Gitee From 940d4f0410a0b2e3c3e0fd0c3a8fec6edb89a8db Mon Sep 17 00:00:00 2001 From: Henry Date: Wed, 4 May 2022 11:49:25 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/library/traits/Backend.php | 371 ++++++++++--------- 1 file changed, 197 insertions(+), 174 deletions(-) diff --git a/application/admin/library/traits/Backend.php b/application/admin/library/traits/Backend.php index 37b730855..b91a5629a 100755 --- a/application/admin/library/traits/Backend.php +++ b/application/admin/library/traits/Backend.php @@ -9,12 +9,16 @@ use PhpOffice\PhpSpreadsheet\Reader\Xlsx; use PhpOffice\PhpSpreadsheet\Reader\Xls; use PhpOffice\PhpSpreadsheet\Reader\Csv; use think\Db; +use think\db\exception\BindParamException; +use think\db\exception\DataNotFoundException; +use think\db\exception\ModelNotFoundException; +use think\exception\DbException; use think\exception\PDOException; use think\exception\ValidateException; +use think\response\Json; trait Backend { - /** * 排除前台提交过来的字段 * @param $params @@ -24,109 +28,114 @@ trait Backend { if (is_array($this->excludeFields)) { foreach ($this->excludeFields as $field) { - if (key_exists($field, $params)) { + if (array_key_exists($field, $params)) { unset($params[$field]); } } - } else { - if (key_exists($this->excludeFields, $params)) { - unset($params[$this->excludeFields]); - } + } else if (array_key_exists($this->excludeFields, $params)) { + unset($params[$this->excludeFields]); } return $params; } - /** * 查看 + * + * @return string|Json + * @throws \think\Exception + * @throws DbException */ public function index() { //设置过滤方法 $this->request->filter(['strip_tags', 'trim']); - if ($this->request->isAjax()) { - //如果发送的来源是Selectpage,则转发到Selectpage - if ($this->request->request('keyField')) { - return $this->selectpage(); - } - list($where, $sort, $order, $offset, $limit) = $this->buildparams(); - - $list = $this->model - ->where($where) - ->order($sort, $order) - ->paginate($limit); - - $result = array("total" => $list->total(), "rows" => $list->items()); - - return json($result); + if (false === $this->request->isAjax()) { + return $this->view->fetch(); + } + //如果发送的来源是 Selectpage,则转发到 Selectpage + if ($this->request->request('keyField')) { + return $this->selectpage(); } - return $this->view->fetch(); + [$where, $sort, $order, $offset, $limit] = $this->buildparams(); + $list = $this->model + ->where($where) + ->order($sort, $order) + ->paginate($limit); + $result = ['total' => $list->total(), 'rows' => $list->items()]; + return json($result); } /** * 回收站 + * + * @return string|Json + * @throws \think\Exception */ public function recyclebin() { //设置过滤方法 $this->request->filter(['strip_tags', 'trim']); - if ($this->request->isAjax()) { - list($where, $sort, $order, $offset, $limit) = $this->buildparams(); - - $list = $this->model - ->onlyTrashed() - ->where($where) - ->order($sort, $order) - ->paginate($limit); - - $result = array("total" => $list->total(), "rows" => $list->items()); - - return json($result); + if (false === $this->request->isAjax()) { + return $this->view->fetch(); } - return $this->view->fetch(); + [$where, $sort, $order, $offset, $limit] = $this->buildparams(); + $list = $this->model + ->onlyTrashed() + ->where($where) + ->order($sort, $order) + ->paginate($limit); + $result = ['total' => $list->total(), 'rows' => $list->items()]; + return json($result); } /** * 添加 + * + * @return string + * @throws \think\Exception */ public function add() { - if ($this->request->isPost()) { - $params = $this->request->post("row/a"); - if ($params) { - $params = $this->preExcludeFields($params); + if (false === $this->request->isPost()) { + return $this->view->fetch(); + } + $params = $this->request->post('row/a'); + if (empty($params)) { + $this->error(__('Parameter %s can not be empty', '')); + } + $params = $this->preExcludeFields($params); - if ($this->dataLimit && $this->dataLimitFieldAutoFill) { - $params[$this->dataLimitField] = $this->auth->id; - } - $result = false; - Db::startTrans(); - try { - //是否采用模型验证 - if ($this->modelValidate) { - $name = str_replace("\\model\\", "\\validate\\", get_class($this->model)); - $validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.add' : $name) : $this->modelValidate; - $this->model->validateFailException(true)->validate($validate); - } - $result = $this->model->allowField(true)->save($params); - Db::commit(); - } catch (ValidateException|PDOException|Exception $e) { - Db::rollback(); - $this->error($e->getMessage()); - } - if ($result !== false) { - $this->success(); - } else { - $this->error(__('No rows were inserted')); - } + if ($this->dataLimit && $this->dataLimitFieldAutoFill) { + $params[$this->dataLimitField] = $this->auth->id; + } + $result = false; + Db::startTrans(); + try { + //是否采用模型验证 + if ($this->modelValidate) { + $name = str_replace("\\model\\", "\\validate\\", get_class($this->model)); + $validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.add' : $name) : $this->modelValidate; + $this->model->validateFailException()->validate($validate); } - $this->error(__('Parameter %s can not be empty', '')); + $result = $this->model->allowField(true)->save($params); + Db::commit(); + } catch (ValidateException|PDOException|Exception $e) { + Db::rollback(); + $this->error($e->getMessage()); + } + if ($result === false) { + $this->error(__('No rows were inserted')); } - return $this->view->fetch(); + $this->success(); } /** * 编辑 + * + * @param $ids + * @return string + * @throws DbException + * @throws \think\Exception */ public function edit($ids = null) { @@ -135,102 +144,108 @@ trait Backend $this->error(__('No Results were found')); } $adminIds = $this->getDataLimitAdminIds(); - if (is_array($adminIds)) { - if (!in_array($row[$this->dataLimitField], $adminIds)) { - $this->error(__('You have no permission')); - } + if (is_array($adminIds) && !in_array($row[$this->dataLimitField], $adminIds)) { + $this->error(__('You have no permission')); } - if ($this->request->isPost()) { - $params = $this->request->post("row/a"); - if ($params) { - $params = $this->preExcludeFields($params); - $result = false; - Db::startTrans(); - try { - //是否采用模型验证 - if ($this->modelValidate) { - $name = str_replace("\\model\\", "\\validate\\", get_class($this->model)); - $validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.edit' : $name) : $this->modelValidate; - $row->validateFailException(true)->validate($validate); - } - $result = $row->allowField(true)->save($params); - Db::commit(); - } catch (ValidateException|PDOException|Exception $e) { - Db::rollback(); - $this->error($e->getMessage()); - } - if ($result !== false) { - $this->success(); - } else { - $this->error(__('No rows were updated')); - } - } + if (false === $this->request->isPost()) { + $this->view->assign('row', $row); + return $this->view->fetch(); + } + $params = $this->request->post('row/a'); + if (empty($params)) { $this->error(__('Parameter %s can not be empty', '')); } - $this->view->assign("row", $row); - return $this->view->fetch(); + $params = $this->preExcludeFields($params); + $result = false; + Db::startTrans(); + try { + //是否采用模型验证 + if ($this->modelValidate) { + $name = str_replace("\\model\\", "\\validate\\", get_class($this->model)); + $validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.edit' : $name) : $this->modelValidate; + $row->validateFailException()->validate($validate); + } + $result = $row->allowField(true)->save($params); + Db::commit(); + } catch (ValidateException|PDOException|Exception $e) { + Db::rollback(); + $this->error($e->getMessage()); + } + if (false === $result) { + $this->error(__('No rows were updated')); + } + $this->success(); } /** * 删除 + * + * @param $ids + * @return void + * @throws DbException + * @throws DataNotFoundException + * @throws ModelNotFoundException */ - public function del($ids = "") + public function del($ids = null) { - if (!$this->request->isPost()) { + if (false === $this->request->isPost()) { $this->error(__("Invalid parameters")); } - $ids = $ids ? $ids : $this->request->post("ids"); - if ($ids) { - $pk = $this->model->getPk(); - $adminIds = $this->getDataLimitAdminIds(); - if (is_array($adminIds)) { - $this->model->where($this->dataLimitField, 'in', $adminIds); - } - $list = $this->model->where($pk, 'in', $ids)->select(); + $ids = $ids ?: $this->request->post("ids"); + if (empty($ids)) { + $this->error(__('Parameter %s can not be empty', 'ids')); + } + $pk = $this->model->getPk(); + $adminIds = $this->getDataLimitAdminIds(); + if (is_array($adminIds)) { + $this->model->where($this->dataLimitField, 'in', $adminIds); + } + $list = $this->model->where($pk, 'in', $ids)->select(); - $count = 0; - Db::startTrans(); - try { - foreach ($list as $k => $v) { - $count += $v->delete(); - } - Db::commit(); - } catch (PDOException|Exception $e) { - Db::rollback(); - $this->error($e->getMessage()); - } - if ($count) { - $this->success(); - } else { - $this->error(__('No rows were deleted')); + $count = 0; + Db::startTrans(); + try { + foreach ($list as $item) { + $count += $item->delete(); } + Db::commit(); + } catch (PDOException|Exception $e) { + Db::rollback(); + $this->error($e->getMessage()); + } + if ($count) { + $this->success(); } - $this->error(__('Parameter %s can not be empty', 'ids')); + $this->error(__('No rows were deleted')); } /** * 真实删除 + * + * @param $ids + * @return void */ - public function destroy($ids = "") + public function destroy($ids = null) { - if (!$this->request->isPost()) { + if (false === $this->request->isPost()) { $this->error(__("Invalid parameters")); } - $ids = $ids ? $ids : $this->request->post("ids"); + $ids = $ids ?: $this->request->post('ids'); + if (empty($ids)) { + $this->error(__('Parameter %s can not be empty', 'ids')); + } $pk = $this->model->getPk(); $adminIds = $this->getDataLimitAdminIds(); if (is_array($adminIds)) { $this->model->where($this->dataLimitField, 'in', $adminIds); } - if ($ids) { - $this->model->where($pk, 'in', $ids); - } + $this->model->where($pk, 'in', $ids); $count = 0; Db::startTrans(); try { $list = $this->model->onlyTrashed()->select(); - foreach ($list as $k => $v) { - $count += $v->delete(true); + foreach ($list as $item) { + $count += $item->delete(true); } Db::commit(); } catch (PDOException|Exception $e) { @@ -239,21 +254,22 @@ trait Backend } if ($count) { $this->success(); - } else { - $this->error(__('No rows were deleted')); } - $this->error(__('Parameter %s can not be empty', 'ids')); + $this->error(__('No rows were deleted')); } /** * 还原 + * + * @param $ids + * @return void */ - public function restore($ids = "") + public function restore($ids = null) { - if (!$this->request->isPost()) { - $this->error(__("Invalid parameters")); + if (false === $this->request->isPost()) { + $this->error(__('Invalid parameters')); } - $ids = $ids ? $ids : $this->request->post("ids"); + $ids = $ids ?: $this->request->post('ids'); $pk = $this->model->getPk(); $adminIds = $this->getDataLimitAdminIds(); if (is_array($adminIds)) { @@ -266,7 +282,7 @@ trait Backend Db::startTrans(); try { $list = $this->model->onlyTrashed()->select(); - foreach ($list as $index => $item) { + foreach ($list as $item) { $count += $item->restore(); } Db::commit(); @@ -282,49 +298,56 @@ trait Backend /** * 批量更新 + * + * @param $ids + * @return void */ - public function multi($ids = "") + public function multi($ids = null) { - if (!$this->request->isPost()) { - $this->error(__("Invalid parameters")); + if (false === $this->request->isPost()) { + $this->error(__('Invalid parameters')); } - $ids = $ids ? $ids : $this->request->post("ids"); - if ($ids) { - if ($this->request->has('params')) { - parse_str($this->request->post("params"), $values); - $values = $this->auth->isSuperAdmin() ? $values : array_intersect_key($values, array_flip(is_array($this->multiFields) ? $this->multiFields : explode(',', $this->multiFields))); - if ($values) { - $adminIds = $this->getDataLimitAdminIds(); - if (is_array($adminIds)) { - $this->model->where($this->dataLimitField, 'in', $adminIds); - } - $count = 0; - Db::startTrans(); - try { - $list = $this->model->where($this->model->getPk(), 'in', $ids)->select(); - foreach ($list as $index => $item) { - $count += $item->allowField(true)->isUpdate(true)->save($values); - } - Db::commit(); - } catch (PDOException|Exception $e) { - Db::rollback(); - $this->error($e->getMessage()); - } - if ($count) { - $this->success(); - } else { - $this->error(__('No rows were updated')); - } - } else { - $this->error(__('You have no permission')); - } + $ids = $ids ?: $this->request->post('ids'); + if (empty($ids)) { + $this->error(__('Parameter %s can not be empty', 'ids')); + } + + if (false === $this->request->has('params')) { + $this->error(__('No rows were updated')); + } + parse_str($this->request->post('params'), $values); + $values = $this->auth->isSuperAdmin() ? $values : array_intersect_key($values, array_flip(is_array($this->multiFields) ? $this->multiFields : explode(',', $this->multiFields))); + if (empty($values)) { + $this->error(__('You have no permission')); + } + $adminIds = $this->getDataLimitAdminIds(); + if (is_array($adminIds)) { + $this->model->where($this->dataLimitField, 'in', $adminIds); + } + $count = 0; + Db::startTrans(); + try { + $list = $this->model->where($this->model->getPk(), 'in', $ids)->select(); + foreach ($list as $item) { + $count += $item->allowField(true)->isUpdate(true)->save($values); } + Db::commit(); + } catch (PDOException|Exception $e) { + Db::rollback(); + $this->error($e->getMessage()); + } + if ($count) { + $this->success(); } - $this->error(__('Parameter %s can not be empty', 'ids')); + $this->error(__('No rows were updated')); } /** * 导入 + * + * @return void + * @throws PDOException + * @throws BindParamException */ protected function import() { @@ -344,12 +367,12 @@ trait Backend if ($ext === 'csv') { $file = fopen($filePath, 'r'); $filePath = tempnam(sys_get_temp_dir(), 'import_csv'); - $fp = fopen($filePath, "w"); + $fp = fopen($filePath, 'w'); $n = 0; while ($line = fgets($file)) { $line = rtrim($line, "\n\r\0"); $encoding = mb_detect_encoding($line, ['utf-8', 'gbk', 'latin1', 'big5']); - if ($encoding != 'utf-8') { + if ($encoding !== 'utf-8') { $line = mb_convert_encoding($line, 'utf-8', $encoding); } if ($n == 0 || preg_match('/^".*"$/', $line)) { -- Gitee From 9eeb35a79b566aea0213d1a768c39b199c010655 Mon Sep 17 00:00:00 2001 From: F4nniu Date: Sat, 7 May 2022 23:43:44 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20framework=20git=20?= =?UTF-8?q?=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index bacfc9d4c..fa0375cc8 100755 --- a/composer.json +++ b/composer.json @@ -38,7 +38,7 @@ "repositories": [ { "type": "git", - "url": "https://gitee.com/karson/framework" + "url": "https://gitee.com/fastadminnet/framework.git" } ] } -- Gitee From f4795e90dadb3dc42ff6cb7ac3e003fd3a642b94 Mon Sep 17 00:00:00 2001 From: F4nniu Date: Sun, 8 May 2022 09:50:15 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E4=B8=BA=E9=80=82=E5=BA=94=E7=8E=B0?= =?UTF-8?q?=E4=BB=A3=E7=BC=96=E8=BE=91=E5=99=A8=20VSCODE=20=E7=9A=84?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E4=BF=AE=E6=94=B9=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extend/fast/Form.php | 78 ++++++++++++++++++++++---------------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/extend/fast/Form.php b/extend/fast/Form.php index faf7d1dbf..92f343dc3 100644 --- a/extend/fast/Form.php +++ b/extend/fast/Form.php @@ -8,45 +8,45 @@ use ArrayAccess; * 表单元素生成 * @class Form * @package fast - * @method string token() static 生成Token - * @method string label(string $name, string $value = null, array $options = []) static label标签 - * @method string input($type, $name, string $value = null, array $options = []) static 按类型生成文本框 - * @method string text(string $name, string $value = null, array $options = []) static 普通文本框 - * @method string password(string $name, array $options = []) static 密码文本框 - * @method string hidden(string $name, string $value = null, array $options = []) static 隐藏文本框 - * @method string email(string $name, string $value = null, array $options = []) static Email文本框 - * @method string url(string $name, string $value = null, array $options = []) static URL文本框 - * @method string file(string $name, array $options = []) static 文件上传组件 - * @method string textarea(string $name, string $value = null, array $options = []) static 多行文本框 - * @method string editor(string $name, string $value = null, array $options = []) static 富文本编辑器 - * @method string select(string $name, array $list = [], string $selected = null, array $options = []) static 下拉列表组件 - * @method string selects(string $name, array $list = [], string $selected = null, array $options = []) static 下拉列表组件(多选) - * @method string selectpicker(string $name, array $list = [], string $selected = null, array $options = []) static 下拉列表组件(友好) - * @method string selectpickers(string $name, array $list = [], string $selected = null, array $options = []) static 下拉列表组件(友好)(多选) - * @method string selectpage(string $name, string $value, string $url, string $field = null, string $primaryKey = null, array $options = []) static 动态下拉列表组件 - * @method string selectpages(string $name, string $value, string $url, string $field = null, string $primaryKey = null, array $options = []) static 动态下拉列表组件(多选) - * @method string citypicker(string $name, string $value, array $options = []) static 城市选择组件 - * @method string switcher(string $name, string $value, array $options = []) static 切换组件 - * @method string datepicker(string $name, string $value, array $options = []) static 日期选择组件 - * @method string timepicker(string $name, string $value, array $options = []) static 时间选择组件 - * @method string datetimepicker(string $name, string $value, array $options = []) static 日期时间选择组件 - * @method string daterange(string $name, string $value, array $options = []) static 日期区间组件 - * @method string timerange(string $name, string $value, array $options = []) static 时间区间组件 - * @method string datetimerange(string $name, string $value, array $options = []) static 日期时间区间组件 - * @method string fieldlist(string $name, string $value, string $title = null, string $template = null, array $options = []) static 字段列表组件 - * @method string cxselect(string $url, array $names = [], array $values = [], array $options = []) static 联动组件 - * @method string selectRange(string $name, string $begin, string $end, string $selected = null, array $options = []) static 选择数字区间 - * @method string selectYear(string $name, string $begin, string $end, string $selected = null, array $options = []) static 选择年 - * @method string selectMonth(string $name, string $selected = null, array $options = [], string $format = '%m') static 选择月 - * @method string checkbox(string $name, string $value = '1', string $checked = null, array $options = []) static 单个复选框 - * @method string checkboxs(string $name, array $list = [], string $checked = null, array $options = []) static 一组复选框 - * @method string radio(string $name, string $value = null, string $checked = null, array $options = [])) static 单个单选框 - * @method string radios(string $name, array $list = [], string $checked = null, array $options = [])) static 一组单选框 - * @method string image(string $name = null, string $value, array $inputAttr = [], array $uploadAttr = [], array $chooseAttr = [], array $previewAttr = []) static 上传图片组件 - * @method string images(string $name = null, string $value, array $inputAttr = [], array $uploadAttr = [], array $chooseAttr = [], array $previewAttr = []) static 上传图片组件(多图)) - * @method string upload(string $name = null, string $value, array $inputAttr = [], array $uploadAttr = [], array $chooseAttr = [], array $previewAttr = []) static 上传文件组件 - * @method string uploads(string $name = null, string $value, array $inputAttr = [], array $uploadAttr = [], array $chooseAttr = [], array $previewAttr = []) static 上传文件组件(多文件)) - * @method string button(string $value = null, array $options = []) static 表单button + * @method static string token() 生成Token + * @method static string label(string $name, string $value = null, array $options = []) label标签 + * @method static string input($type, $name, string $value = null, array $options = []) 按类型生成文本框 + * @method static string text(string $name, string $value = null, array $options = []) 普通文本框 + * @method static string password(string $name, array $options = []) 密码文本框 + * @method static string hidden(string $name, string $value = null, array $options = []) 隐藏文本框 + * @method static string email(string $name, string $value = null, array $options = []) Email文本框 + * @method static string url(string $name, string $value = null, array $options = []) URL文本框 + * @method static string file(string $name, array $options = []) 文件上传组件 + * @method static string textarea(string $name, string $value = null, array $options = []) 多行文本框 + * @method static string editor(string $name, string $value = null, array $options = []) 富文本编辑器 + * @method static string select(string $name, array $list = [], string $selected = null, array $options = []) 下拉列表组件 + * @method static string selects(string $name, array $list = [], string $selected = null, array $options = []) 下拉列表组件(多选) + * @method static string selectpicker(string $name, array $list = [], string $selected = null, array $options = []) 下拉列表组件(友好) + * @method static string selectpickers(string $name, array $list = [], string $selected = null, array $options = []) 下拉列表组件(友好)(多选) + * @method static string selectpage(string $name, string $value, string $url, string $field = null, string $primaryKey = null, array $options = []) 动态下拉列表组件 + * @method static string selectpages(string $name, string $value, string $url, string $field = null, string $primaryKey = null, array $options = []) 动态下拉列表组件(多选) + * @method static string citypicker(string $name, string $value, array $options = []) 城市选择组件 + * @method static string switcher(string $name, string $value, array $options = []) 切换组件 + * @method static string datepicker(string $name, string $value, array $options = []) 日期选择组件 + * @method static string timepicker(string $name, string $value, array $options = []) 时间选择组件 + * @method static string datetimepicker(string $name, string $value, array $options = []) 日期时间选择组件 + * @method static string daterange(string $name, string $value, array $options = []) 日期区间组件 + * @method static string timerange(string $name, string $value, array $options = []) 时间区间组件 + * @method static string datetimerange(string $name, string $value, array $options = []) 日期时间区间组件 + * @method static string fieldlist(string $name, string $value, string $title = null, string $template = null, array $options = []) 字段列表组件 + * @method static string cxselect(string $url, array $names = [], array $values = [], array $options = []) 联动组件 + * @method static string selectRange(string $name, string $begin, string $end, string $selected = null, array $options = []) 选择数字区间 + * @method static string selectYear(string $name, string $begin, string $end, string $selected = null, array $options = []) 选择年 + * @method static string selectMonth(string $name, string $selected = null, array $options = [], string $format = '%m') 选择月 + * @method static string checkbox(string $name, string $value = '1', string $checked = null, array $options = []) 单个复选框 + * @method static string checkboxs(string $name, array $list = [], string $checked = null, array $options = []) 一组复选框 + * @method static string radio(string $name, string $value = null, string $checked = null, array $options = [])) 单个单选框 + * @method static string radios(string $name, array $list = [], string $checked = null, array $options = [])) 一组单选框 + * @method static string image(string $name = null, string $value, array $inputAttr = [], array $uploadAttr = [], array $chooseAttr = [], array $previewAttr = []) 上传图片组件 + * @method static string images(string $name = null, string $value, array $inputAttr = [], array $uploadAttr = [], array $chooseAttr = [], array $previewAttr = []) 上传图片组件(多图)) + * @method static string upload(string $name = null, string $value, array $inputAttr = [], array $uploadAttr = [], array $chooseAttr = [], array $previewAttr = []) 上传文件组件 + * @method static string uploads(string $name = null, string $value, array $inputAttr = [], array $uploadAttr = [], array $chooseAttr = [], array $previewAttr = []) 上传文件组件(多文件)) + * @method static string button(string $value = null, array $options = []) 表单button */ class Form { -- Gitee