1
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user