1
This commit is contained in:
@@ -550,12 +550,11 @@ class Preaccept extends Base
|
||||
$data = $this->request->post();
|
||||
$rule = new Validate([
|
||||
"amc_id"=>"require",
|
||||
"remark"=>"require"
|
||||
]);
|
||||
if(!$rule->check($data)){
|
||||
return jsonError($rule->getError());
|
||||
}
|
||||
$this->article_main_check_obj->where("amc_id",$data['amc_id'])->update(['remark'=>$data['remark'],"estate"=>0]);
|
||||
$this->article_main_check_obj->where("amc_id",$data['amc_id'])->update(["estate"=>0]);
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
@@ -796,7 +795,7 @@ class Preaccept extends Base
|
||||
|
||||
private function addBRow($article_id,$am_id){
|
||||
if($am_id==0){//顶行
|
||||
$this->article_main_obj->where("article_id",$article_id)->whereIn("state",[0,2])->inc("sort",1);
|
||||
$this->article_main_obj->where("article_id",$article_id)->inc("sort",1);
|
||||
$insert['article_id'] = $article_id;
|
||||
$insert['content'] = "";
|
||||
$insert['sort'] = 1;
|
||||
@@ -804,7 +803,7 @@ class Preaccept extends Base
|
||||
$this->article_main_obj->insert($insert);
|
||||
}else{
|
||||
$am_info = $this->article_main_obj->where("am_id",$am_id)->find();
|
||||
$this->article_main_obj->where("article_id",$article_id)->where("sort",">",$am_info['sort'])->whereIn("state",[0,2])->inc("sort",1);
|
||||
$this->article_main_obj->where("article_id",$article_id)->where("sort",">",$am_info['sort'])->inc("sort",1);
|
||||
$insert['article_id'] = $article_id;
|
||||
$insert['content'] = "";
|
||||
$insert['sort'] = $am_info['sort']+1;
|
||||
@@ -874,6 +873,12 @@ class Preaccept extends Base
|
||||
if(!$rule->check($data)){
|
||||
return jsonError($rule->getError());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$this->article_main_obj->where("am_id",$data['am_id'])->update(['state'=>1]);
|
||||
|
||||
return jsonSuccess([]);
|
||||
|
||||
Reference in New Issue
Block a user