去除的同名检测限制,合同api列表数据排序按照序号倒序查询

This commit is contained in:
hdm 2023-04-14 00:05:51 +08:00
parent ab3319c6a7
commit 42420b1123
2 changed files with 3 additions and 5 deletions

View File

@ -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);

View File

@ -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' => '缺少更新条件',