Merge pull request '优化' (#448) from feature/testing_resource_lhcgx into master

Reviewed-on: http://8.136.139.249:3000/wmtx/platform/pulls/448
master
廖金灵 3 years ago
commit 07efb99059

@ -744,22 +744,35 @@ class ConsoleController extends Think {
} 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();
$fromPromoteId = 0;
$fromCompanyId = 0;
$toPromoteId = 0;
$toCompanyId = 0;
$adminId = 0;
$service->shiftPromote([
'from_promote_id' => $fromPromoteId,
'to_promote_id' => $toPromoteId,
'from_promote_id' => $formPromote['id'],
'to_promote_id' => $toPromote['id'],
'shift_ids' => '',
]);
M('promote', 'tab_')->where(['level1_id' => $fromPromoteId, 'company_id' => $fromCompanyId])->save([
'company_id' => $toCompanyId,
'admin_id' => $adminId
M('promote', 'tab_')->where(['level1_id' => $formPromote['id'], 'company_id' => $formPromote['company_id']])->save([
'company_id' => $toPromote['company_id'],
'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([
'chain' => ['exp', 'REPLACE(chain, "/' . $fromPromote['id'] . '/","/' . $toPromote['id'] . '/")'],
'level' . $toPromote['level'] => $toPromote['id']
'level' . $toPromote['level'] . '_id' => $toPromote['id']
]);
$model->commit();

Loading…
Cancel
Save