重新激活
This commit is contained in:
parent
df1b3c8dbe
commit
c804ef0833
@ -28,10 +28,39 @@ foreach ($data as $item) {
|
||||
$month = $content['1'];
|
||||
|
||||
$attributes['type'] = 10;
|
||||
$attributes['valid_start_time'] = $item[2];
|
||||
$attributes['valid_start_time'] = strtotime($item[3]);
|
||||
$attributes['valid_end_time'] = strtotime("+{$month} month", $attributes['valid_start_time']);
|
||||
$attributes['valid_end_time'] = strtotime('-1 second', $attributes['valid_end_time']);
|
||||
$attributes['create_time'] = $item[2];
|
||||
$attributes['create_time'] = strtotime($item[3]);
|
||||
$attributes['task_number'] = 'jh20190425';
|
||||
|
||||
DB::transaction(function () use ($attributes) {
|
||||
unset($attributes['id']);
|
||||
DB::connection('vd_old')->table('ckb_custom_handle_log')->insert($attributes);
|
||||
DB::connection('vd_old')->table('ckb_custom')->where('custom_no', $attributes['custom_no'])->update([
|
||||
'card_cycle_start' => $attributes['valid_start_time'],
|
||||
'card_cycle_end' => $attributes['valid_end_time'],
|
||||
]);
|
||||
DB::connection('vd_old')->table('ckb_user_package')->where('custom_no', $attributes['custom_no'])->update([
|
||||
'service_start_time' => $attributes['valid_start_time'],
|
||||
'service_end_time' => $attributes['valid_end_time'],
|
||||
]);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (count($rows) == 2 && ($rows[0]['type'] == 10 || $rows[1]['type'] == 10)) {
|
||||
echo '*' . PHP_EOL;
|
||||
$attributes = $rows[0];
|
||||
|
||||
if (preg_match('/_(\d+)MONTH/', $attributes['content'], $content)) {
|
||||
$month = $content['1'];
|
||||
|
||||
$attributes['type'] = 10;
|
||||
$attributes['valid_start_time'] = strtotime($item[3]);
|
||||
$attributes['valid_end_time'] = strtotime("+{$month} month", $attributes['valid_start_time']);
|
||||
$attributes['valid_end_time'] = strtotime('-1 second', $attributes['valid_end_time']);
|
||||
$attributes['create_time'] = strtotime($item[3]);
|
||||
$attributes['task_number'] = 'jh20190425';
|
||||
|
||||
DB::transaction(function () use ($attributes) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user