从dev复制代码

master
liuweiwen 5 years ago
parent 7431072bbf
commit 08f8c518a6

@ -1296,17 +1296,23 @@ class PromoteController extends ThinkController
public function belong_verify()
{
$verify_status = $_REQUEST['verify_status'];
$res = M('promote_belong', 'tab_')->where(['id' => ['in', I('ids')]])->save(['verify_status' => $verify_status]);
if (!is_null($res)) {
$promote_belongs = M('promote_belong', 'tab_')->where(['id' => ['in', I('ids')]])->select();
foreach ($promote_belongs as $promote_belong) {
$update = [
'company_belong' => $promote_belong['company_belong'],
'company_relation' => $promote_belong['company_relation']
];
$res = M("promote", "tab_")
->where("chain like '%/{$promote_belong['promote_id']}/%' or id={$promote_belong['promote_id']} ")
->save($update);
$res = M('promote_belong', 'tab_')->where(['id' => ['in', I('ids')]])->save([
'verify_status' => $verify_status,
'approver_id' => getAdmin(),
'approver_name' => getAdmin('username'),
]);
if (!is_null($res) ) {
if ($verify_status == 1) {//审核通过才修改推广员的归属关系
$promote_belongs = M('promote_belong', 'tab_')->where(['id' => ['in', I('ids')]])->select();
foreach ($promote_belongs as $promote_belong) {
$update = [
'company_belong' => $promote_belong['company_belong'],
'company_relation' => $promote_belong['company_relation']
];
$res = M("promote", "tab_")
->where("chain like '%/{$promote_belong['promote_id']}/%' or id={$promote_belong['promote_id']} ")
->save($update);
}
}
$this->success("操作成功", U('belong'));
} else {

Loading…
Cancel
Save