master
ELF 3 years ago
parent b455770e42
commit ba3d1dadd2

@ -744,22 +744,35 @@ class ConsoleController extends Think {
} while($hasNext); } while($hasNext);
} }
/* public function shiftPromote() public function shiftPromote()
{ {
$fromAccount = 'longyan';
$toAccount = 'nola2021';
$formPromote = M('promote', 'tab_')->where(['account' => $fromAccount])->find();
$toPromote = M('promote', 'tab_')->where(['account' => $toAccount])->find();
$ids = M('promote', 'tab_')->where(['level1_id' => $formPromote['id'], 'company_id' => $formPromote['company_id']])->getField('id', true);
var_dump([
'from_promote_id' => $formPromote['id'],
'to_promote_id' => $toPromote['id'],
'shift_ids' => '',
]);
$service = new PromoteService(); $service = new PromoteService();
$fromPromoteId = 0;
$fromCompanyId = 0;
$toPromoteId = 0;
$toCompanyId = 0;
$adminId = 0;
$service->shiftPromote([ $service->shiftPromote([
'from_promote_id' => $fromPromoteId, 'from_promote_id' => $formPromote['id'],
'to_promote_id' => $toPromoteId, 'to_promote_id' => $toPromote['id'],
'shift_ids' => '', 'shift_ids' => '',
]); ]);
M('promote', 'tab_')->where(['level1_id' => $fromPromoteId, 'company_id' => $fromCompanyId])->save([ M('promote', 'tab_')->where(['level1_id' => $formPromote['id'], 'company_id' => $formPromote['company_id']])->save([
'company_id' => $toCompanyId, 'company_id' => $toPromote['company_id'],
'admin_id' => $adminId 'admin_id' => $toPromote['admin_id'],
]); ]);
} */
if (count($ids)) {
$orderTime = strtotime('2021-08-01 00:00:00');
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']]);
}
}
} }

@ -252,7 +252,7 @@ class PromoteService {
M('promote', 'tab_')->where($secondMap)->save([ M('promote', 'tab_')->where($secondMap)->save([
'chain' => ['exp', 'REPLACE(chain, "/' . $fromPromote['id'] . '/","/' . $toPromote['id'] . '/")'], 'chain' => ['exp', 'REPLACE(chain, "/' . $fromPromote['id'] . '/","/' . $toPromote['id'] . '/")'],
'level' . $toPromote['level'] => $toPromote['id'] 'level' . $toPromote['level'] . '_id' => $toPromote['id']
]); ]);
$model->commit(); $model->commit();

Loading…
Cancel
Save