diff --git a/.gitee/ISSUE_TEMPLATE.zh-CN.md b/.gitee/ISSUE_TEMPLATE.zh-CN.md new file mode 100644 index 00000000..c56a39e6 --- /dev/null +++ b/.gitee/ISSUE_TEMPLATE.zh-CN.md @@ -0,0 +1,22 @@ +### 类型 +类型(问题/建议/其他):? + + +### 现象 +现象(请详细描述一下复现过程):? + + +### 期望结果 +期望结果(请详细描述一下你说期望的结果):? + + +### 环境 +(请详细说明一下你的运行环境) +- 操作系统(Linux/Windows/Other):? +- Web Server(NGINX/Apache/Other):? +- PHP 版本(7.2/7.3/7.4/8.0/8.1/8.2/Other):? +- MySQL 版本(5.6/5.7/8.0/Other):? +- 服务器面板(BT/phpStudy/XAMPP/其他/无):? +- FastAdmin 版本:? +- 浏览器(Chrome/IE/Edge/其他):? +- 报错信息:? diff --git a/application/admin/command/Crud.php b/application/admin/command/Crud.php index 390cb953..d66f3229 100755 --- a/application/admin/command/Crud.php +++ b/application/admin/command/Crud.php @@ -957,6 +957,11 @@ class Crud extends Command $attrArr['size'] = 50; } + //字段默认值判断 + if ('NULL' == $defaultValue || "''" == $defaultValue) { + $defaultValue = ''; + } + $formAddElement = Form::input($inputType, $fieldName, $defaultValue, $attrArr); $formEditElement = Form::input($inputType, $fieldName, $editValue, $attrArr); if ($search && $replace) { diff --git a/application/api/controller/User.php b/application/api/controller/User.php index b13c9002..32f9f6bc 100644 --- a/application/api/controller/User.php +++ b/application/api/controller/User.php @@ -298,7 +298,7 @@ class User extends Api */ public function resetpwd() { - $type = $this->request->post("type"); + $type = $this->request->post("type", "mobile"); $mobile = $this->request->post("mobile"); $email = $this->request->post("email"); $newpassword = $this->request->post("newpassword"); diff --git a/application/common/controller/Backend.php b/application/common/controller/Backend.php index 51cef5fd..58fd459d 100644 --- a/application/common/controller/Backend.php +++ b/application/common/controller/Backend.php @@ -284,7 +284,7 @@ class Backend extends Controller $bind = []; $name = ''; $aliasName = ''; - if (!empty($this->model) && $this->relationSearch) { + if (!empty($this->model) && $relationSearch) { $name = $this->model->getTable(); $alias[$name] = Loader::parseName(basename(str_replace('\\', '/', get_class($this->model)))); $aliasName = $alias[$name] . '.'; diff --git a/extend/fast/Date.php b/extend/fast/Date.php index 84919255..ce018f1b 100644 --- a/extend/fast/Date.php +++ b/extend/fast/Date.php @@ -194,10 +194,14 @@ class Date $time = $position ? $_timestamp : mktime(23, 59, 59, $month + $offset, self::days_in_month(date("m", $_timestamp), date("Y", $_timestamp)), $year); break; case 'quarter': - $_month = date("m", mktime(0, 0, 0, (ceil(date('n', mktime(0, 0, 0, $month, $day, $year)) / 3) + $offset) * 3, $day, $year)); + $quarter = ceil(date('n', $baseTime) / 3) + $offset; + $month = $quarter * 3; + $offset_year = ceil($month/12) - 1; + $year = $year + $offset_year; + $month = $month - ($offset_year * 12); $time = $position ? - mktime(0, 0, 0, 1 + ((ceil(date('n', $baseTime) / 3) + $offset) - 1) * 3, 1, $year) : - mktime(23, 59, 59, (ceil(date('n', $baseTime) / 3) + $offset) * 3, self::days_in_month((ceil(date('n', $baseTime) / 3) + $offset) * 3, $year), $year); + mktime(0, 0, 0, $month-2, 1, $year) : + mktime(23, 59, 59, $month, self::days_in_month($month, $year), $year); break; case 'year': $time = $position ? mktime(0, 0, 0, 1, 1, $year + $offset) : mktime(23, 59, 59, 12, 31, $year + $offset);