优化自动审核

master
chenzhi 3 years ago
parent e9a8356c77
commit 0cdef815e2

@ -1638,29 +1638,25 @@ class StatementMangementController extends ThinkController
}
//自动审核通过
public function autoVerify($settlmentSet = [],$id = 0) {
public function autoVerify(&$settlmentSet = [],$id = 0) {
if (!$id) {
return false;
}
$i = 0;
$count = count($settlmentSet);
$detail = json_encode(["user"=>$_SESSION['onethink_admin']['user_auth']['username'],"time"=>date("Y-m-d H:i:s",time())]);
foreach ($settlmentSet as $key => $value) {
if ($value['company_id']) {
$data = SM("promote_company","tab_")->where(["id"=>$value['company_id']])->find();
if (in_array($data["company_belong"],[0,3])) {
if (!$data || in_array($data["company_belong"],[0,3])) {
$settlmentSet[$key]['is_check'] = 1;
$settlmentSet[$key]['check_detail'] = $detail;
$i++;
}
}
}
if ($i == $count) {
$detail = json_encode(["user"=>$_SESSION['onethink_admin']['user_auth']['username'],"time"=>date("Y-m-d H:i:s",time())]);
SM("reward_record","tab_")->where(["id"=>['in',$id]])->save(["is_verify"=>1,"verify_detail"=>$detail]);
SM("reward_record","tab_")->where(["id"=>['in',$id]])->save(["is_verify"=>1]);
}
}

Loading…
Cancel
Save