This commit is contained in:
wangjinlei
2023-07-24 09:35:35 +08:00
parent b1a23ce87a
commit 0b706eca4c
4 changed files with 84 additions and 3 deletions

View File

@@ -263,12 +263,25 @@ class Preaccept extends Base
if (!$rule->check($data)) {
return jsonError($rule->getError());
}
$refer_info = $this->production_article_refer_obj->where('p_refer_id', $data['p_refer_id'])->find();
$this->production_article_refer_obj->where('p_article_id', $refer_info['p_article_id'])->where('index', ">", $refer_info['index'])->where('state', 0)->setDec('index');
$this->production_article_refer_obj->where('p_refer_id', $data['p_refer_id'])->update(['state' => 1]);
$this->delOneRefer($data['p_refer_id']);
return jsonSuccess([]);
}
public function delRefers(){
$data = $this->request->post();
$rule = new Validate([
"ids" => "require|array"
]);
if(!$rule->check($data)){
return jsonError($rule->getError());
}
foreach ($data['ids'] as $v){
$this->delOneRefer($v);
}
return jsonSuccess([]);
}
/**编辑refer
* @return \think\response\Json
* @throws \think\Exception