From 42420b11238ae6b82892a920b7a758f7b0bf1235 Mon Sep 17 00:00:00 2001 From: hdm <hdm58@qq.com> Date: Fri, 14 Apr 2023 00:05:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E7=9A=84=E5=90=8C=E5=90=8D?= =?UTF-8?q?=E6=A3=80=E6=B5=8B=E9=99=90=E5=88=B6=EF=BC=8C=E5=90=88=E5=90=8C?= =?UTF-8?q?api=E5=88=97=E8=A1=A8=E6=95=B0=E6=8D=AE=E6=8E=92=E5=BA=8F?= =?UTF-8?q?=E6=8C=89=E7=85=A7=E5=BA=8F=E5=8F=B7=E5=80=92=E5=BA=8F=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/contract/controller/Api.php | 2 +- app/contract/validate/ContractCheck.php | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/app/contract/controller/Api.php b/app/contract/controller/Api.php index 85acd80..4c6bf37 100644 --- a/app/contract/controller/Api.php +++ b/app/contract/controller/Api.php @@ -38,7 +38,7 @@ class Api extends BaseController $rows = empty($param['limit']) ? get_config('app.page_size') : $param['limit']; $list = Db::name('Contract') ->field('id,name,customer_id,sign_uid,sign_time') - ->order('end_time asc') + ->order('id desc') ->where($where) ->where(function ($query) use($whereOr) { $query->whereOr($whereOr); diff --git a/app/contract/validate/ContractCheck.php b/app/contract/validate/ContractCheck.php index e8fa69b..a7434de 100644 --- a/app/contract/validate/ContractCheck.php +++ b/app/contract/validate/ContractCheck.php @@ -12,8 +12,8 @@ use think\Validate; class ContractCheck extends Validate { protected $rule = [ - 'name' => 'require|unique:contract', - 'code' => 'require|unique:contract', + 'name' => 'require', + 'code' => 'require', 'id' => 'require', 'cost' => 'number', 'cate_id' => 'require', @@ -21,9 +21,7 @@ class ContractCheck extends Validate protected $message = [ 'name.require' => '合同名称不能为空', - 'name.unique' => '同样的合同名称已经存在', 'code.require' => '合同编号不能为空', - 'code.unique' => '同样的合同编号已经存在', 'cost.number' => '价格只能是数字', 'cate_id.require' => '所属分类为必选', 'id.require' => '缺少更新条件',