Merge pull request '优化' (#494) from hotfix/mig_promote into master

Reviewed-on: http://8.136.139.249:3000/wmtx/platform/pulls/494
master
廖金灵 3 years ago
commit dded4ec706

@ -758,8 +758,8 @@ class ConsoleController extends Think {
public function shiftPromote() public function shiftPromote()
{ {
$fromAccount = 'longyan'; $fromAccount = 'nola2021';
$toAccount = 'nola2021'; $toAccount = 'shanye001';
$formPromote = M('promote', 'tab_')->where(['account' => $fromAccount])->find(); $formPromote = M('promote', 'tab_')->where(['account' => $fromAccount])->find();
$toPromote = M('promote', 'tab_')->where(['account' => $toAccount])->find(); $toPromote = M('promote', 'tab_')->where(['account' => $toAccount])->find();
@ -768,23 +768,23 @@ class ConsoleController extends Think {
var_dump([ var_dump([
'from_promote_id' => $formPromote['id'], 'from_promote_id' => $formPromote['id'],
'to_promote_id' => $toPromote['id'], 'to_promote_id' => $toPromote['id'],
'shift_ids' => '', 'shift_ids' => '7805',
]); ]);
$service = new PromoteService(); $service = new PromoteService();
$service->shiftPromote([ $service->shiftPromote([
'from_promote_id' => $formPromote['id'], 'from_promote_id' => $formPromote['id'],
'to_promote_id' => $toPromote['id'], 'to_promote_id' => $toPromote['id'],
'shift_ids' => '', 'shift_ids' => '7805',
]); ]);
M('promote', 'tab_')->where(['level1_id' => $formPromote['id'], 'company_id' => $formPromote['company_id']])->save([ M('promote', 'tab_')->where(['level1_id' => $formPromote['id'], 'level2_id' => 7805, 'company_id' => $formPromote['company_id']])->save([
'company_id' => $toPromote['company_id'], 'company_id' => $toPromote['company_id'],
'admin_id' => $toPromote['admin_id'], 'admin_id' => $toPromote['admin_id'],
]); ]);
if (count($ids)) { /* if (count($ids)) {
$orderTime = strtotime('2021-08-01 00:00:00'); $orderTime = strtotime('2021-09-01 00:00:00');
M('deposit', 'tab_')->where(['promote_id' => ['in', $ids], 'create_time' => ['egt', $orderTime]])->save(['market_admin_id' => $toPromote['admin_id']]); M('deposit', 'tab_')->where(['promote_id' => ['in', $ids], 'create_time' => ['egt', $orderTime]])->save(['market_admin_id' => $toPromote['admin_id']]);
M('spend', 'tab_')->where(['promote_id' => ['in', $ids], 'spend_time' => ['egt', $orderTime]])->save(['market_admin_id' => $toPromote['admin_id']]); M('spend', 'tab_')->where(['promote_id' => ['in', $ids], 'spend_time' => ['egt', $orderTime]])->save(['market_admin_id' => $toPromote['admin_id']]);
} } */
} }
} }

@ -248,7 +248,7 @@ class PromoteService {
'parent_id' => $toPromote['id'], 'parent_id' => $toPromote['id'],
'parent_name' => $toPromote['account'], 'parent_name' => $toPromote['account'],
'chain' => $toPromote['chain'] . $toPromote['id'] . '/', 'chain' => $toPromote['chain'] . $toPromote['id'] . '/',
'level' . $toPromote['level'] => $toPromote['id'] 'level' . $toPromote['level'] . '_id' => $toPromote['id']
]); ]);
M('promote', 'tab_')->where($secondMap)->save([ M('promote', 'tab_')->where($secondMap)->save([

Loading…
Cancel
Save