wugg 1 ano atrás
pai
commit
8414f05229
1 arquivos alterados com 15 adições e 5 exclusões
  1. 15 5
      app/admin/controller/DataChange.php

+ 15 - 5
app/admin/controller/DataChange.php

@@ -20,8 +20,13 @@ class DataChange extends Base
 	* @throws \think\db\exception\ModelNotFoundException
 	 */
   public function create(){
-  	$param =$this->request->only(["code"=>'',"type"=>"",'oaCode'=>'',"change"=>""],"post","trim");
-  	$valid =Validate::rule(["code|订单编号"=>"require","type|订单类型"=>"require|number|in:1,2,3","change|修改字段内容"=>"require|array"]);
+  	$param =$this->request->only(["code"=>'',"type"=>"",'oaCode'=>'',"change"=>"","apply_id"=>"","apply_name"=>""],
+  	"post","trim");
+  	$valid =Validate::rule([
+  		"code|订单编号"=>"require",
+  	"type|订单类型"=>"require|number|in:1,2,3",
+  	"appply_id|申请人"=>"require|number",
+  	"change|修改字段内容"=>"require|array"]);
   	if($valid->check($param)==false) return error_show(1004,$valid->getError());
   	if($param['type']==1){
   		$orderinfo = Db::name("purchease_order")->where(["cgdNo"=>$param['code']])->find();
@@ -58,8 +63,10 @@ class DataChange extends Base
   		"before"=>$before,
   		"after"=>$after,
   		"oaCode"=>$param['oaCode'],
-  		"apply_id"=>$this->uid,
-  		"apply_name"=>$this->uname,
+  		"apply_id"=>$param['apply_id'],
+  		"apply_name"=>$param['apply_name'],
+  		'creater_id'=>$this->uid,
+  		'creater'=>$this->uname,
   		"status"=>1,
   		];
   	$in =$this->model->save($data);
@@ -67,9 +74,12 @@ class DataChange extends Base
   }
   
   public function list(){
-  	$param = $this->request->only(["code"=>"","oaCode"=>"","type"=>"","status"=>"","page"=>1,"size"=>15],"post","trim");
+  	$param = $this->request->only(["code"=>"","oaCode"=>"","type"=>"","apply_name"=>"","status"=>"","page"=>1,
+  	"size"=>15],"post","trim");
   	$where=[];
   	$param['code']==''?: $where[]=["code","like","%{$param['code']}%"];
+  	$param['apply_name']==''?: $where[]=["apply_name","like","%{$param['apply_name']}%"];
+  	$param['oaCode']==''?: $where[]=["oaCode","like","%{$param['oaCode']}%"];
   	$param['type']==''?: $where[]=["type","=",$param['type']];
   	$param['status']==''?: $where[]=["status","=",$param['status']];
   	$list = $this->model->where($where)->json(["before","after"])->order("id","desc")->paginate(["page"=>$param['page'],