master
elf 2 years ago
parent de1feb8f1e
commit d710a9ba01

@ -1364,12 +1364,15 @@ class TimingController extends AdminController {
// '13272727572' => 'jiangshibo01',
// 'hdfzxyz' => 'hdfzxyz01',
];
foreach ($items as $fromPromoteAccount => $toPromoteAccount) {
$toPromote = M('promote','tab_')->field(['id', 'account'])->where(['account'=> $toPromoteAccount])->find();
$users = M("user","tab_")->where("promote_account='" . $fromPromoteAccount . "'")->select();
foreach ($users as $user) {
$params = [
'promote_id_to' => $toPromoteAccount,
'promote_id' => $toPromoteAccount,
'promote_id_to' => $toPromote['id'],
'promote_id' => $toPromote['id'],
'order_time' => '2022-08-01 00:00:00',
'allow_over_week' => 1,
'remark' => '后台迁移',
@ -1377,23 +1380,22 @@ class TimingController extends AdminController {
'account' => $user['account'],
];
var_dump($params);
// $this->shiftPlayer($params);
// $this->shiftPlayer($params, $user, $toPromote);
}
}
}
private function shiftPlayer($params) {
private function shiftPlayer($params, $user, $toPromote) {
$service = new MendService();
try {
$service->addMendTask($params);
$userData = M('user','tab_')->field(['account', 'promote_id', 'promote_account'])->where(['id' => $params['user_id']])->find();
$promoteToData = M('promote','tab_')->field('account')->where(['id'=> $params['prmoote_id_to']])->find();
$user = M('user','tab_')->field(['account', 'promote_id', 'promote_account'])->where(['id' => $params['user_id']])->find();
addOperationLog([
'op_type' => 1,
'key' => $userData['account'].'/'.$userData['promote_account'].'/'.$promoteToData['account'],
'key' => $user['account'] . '/' . $user['promote_account'].'/' . $toPromote['account'],
'op_name' => '编辑推广补链',
'url' => U('Mend/edit', ['id' => $userData['id']]),
'url' => U('Mend/edit', ['id' => $user['id']]),
'menu' => '推广员-推广员管理-推广补链-编辑推广补链',
'content' => json_encode($params)
]);

Loading…
Cancel
Save