diff --git a/app/Console/Commands/MigrateOrderGoods.php b/app/Console/Commands/MigrateOrderGoods.php deleted file mode 100644 index 855b78a..0000000 --- a/app/Console/Commands/MigrateOrderGoods.php +++ /dev/null @@ -1,80 +0,0 @@ -get(); - - $bar = $this->output->createProgressBar(count($oldData)); - $bar->start(); - - $newData = []; - foreach ($oldData as $key => $value) { - - $goods =DB::table('ims_cjdc_goods')->find($value->good_id); - - $newData[] = [ - 'order_id' => $value->order_id ?? 0, - 'goods_id' => $value->good_id ?? 0, - 'number' => $value->number ?? 0, - 'status' => 1, - 'price' => $value->money ?? 0, - 'original_price' => $goods->money2 ?? 0, - 'vip_price' => $goods->vip_money ?? 0, - 'name' => $value->name ?? '', - 'goods_unit' => $value->good_unit ?? '', - 'cover_img' => $value->img ?? '', - 'spec' => json_encode([]), - 'refund_time' => 0, - 'created_at' => time(), - 'updated_at' => time(), - 'refuse_refund_note' => '', - ]; - - $bar->advance(); - } - - // insert new data to new table - DB::table('lanzu_order_goods')->insert($newData); - - $bar->finish(); - return 0; - } -} diff --git a/app/Console/Commands/MigrateOrderMain.php b/app/Console/Commands/MigrateOrderMain.php deleted file mode 100644 index 7c497d0..0000000 --- a/app/Console/Commands/MigrateOrderMain.php +++ /dev/null @@ -1,96 +0,0 @@ -get(); - - $bar = $this->output->createProgressBar(count($oldData)); - $bar->start(); - - $newData = []; - foreach ($oldData as $key => $value) { - - $newData[] = [ - 'market_id' => $value->market_id ?? 0, - 'order_num' => $value->order_num ?? '', - 'global_order_id' => $value->global_order_id ?? 0, - 'user_id' => $value->user_id ?? 0, - 'pay_type' => $value->pay_type ?? 0, - 'type' => $value->type ?? 0, - 'order_type' => $value->order_type ?? 0, - 'shipping_type' => $value->dada_status==0 ? 1 : 2, - 'money' => $value->money ?? 0, - 'total_money' => $value->total_money ?? 0, - 'services_money' => 0, - 'coupon_money' => $value->yhq_money2 ?? 0, - 'delivery_money' => $value->dada_fee ?? 0, - 'state' => $value->state ?? 0, - 'pay_time' => $value->pay_time ? strtotime($value->pay_time) : 0, - 'receive_time' => $value->jd_time ? strtotime($value->jd_time) : 0, - 'delivery_time' => 0, - 'complete_time' => $value->complete_time ? strtotime($value->complete_time) : 0, - 'cancel_time' => $value->complete_time ? strtotime($value->complete_time) : 0, - 'refund_time' => $value->refund_time ?? 0, - 'tel' => $value->tel ?? '', - 'address' => $value->address ?? '', - 'lat' => $value->lat ?? '', - 'lng' => $value->lng ?? '', - 'name' => $value->name ?? '', - 'print_num' => $value->print_num ?? 0, - 'plat' => $value->plat ?? 0, - 'refuse_refund_note' => $value->refuse_refund_note ?? '', - 'delivery_time_note' => $value->delivery_time ?? '', - 'total_refund_note' => $value->total_refund_note ?? '', - 'note' => $value->note ?? '', - 'created_at' => $value->time_add ?? 0, - 'updated_at' => 0, - ]; - - $bar->advance(); - } - - // insert new data to new table - DB::table('lanzu_order_main')->insert($newData); - - $bar->finish(); - return 0; - } -} diff --git a/app/Console/Commands/MigrateStoreWithdrawal.php b/app/Console/Commands/MigrateStoreWithdrawal.php index c4fda1b..2782dab 100644 --- a/app/Console/Commands/MigrateStoreWithdrawal.php +++ b/app/Console/Commands/MigrateStoreWithdrawal.php @@ -58,7 +58,7 @@ class MigrateStoreWithdrawal extends Command $startTime = time(); $error = []; foreach ($oldData as $key => $value){ - $withdrawalId = $value->id; + $withdrawalId = $value->id ?? 0; // 判断是否存在 $exist = DB::table($newTableName)->where('id',$withdrawalId)->exists(); if($exist){ @@ -66,21 +66,21 @@ class MigrateStoreWithdrawal extends Command } $newData =[ 'id'=>$withdrawalId, - 'store_id'=>$value->store_id, + 'store_id'=>$value->store_id ?? 0, - 'name'=> ($value->name == 'undefined') ? '': $value->name, - 'tel'=>$value->tel, + 'name'=> (empty($value->name) || $value->name == 'undefined') ? '': $value->name, + 'tel'=>$value->tel ?? 0, 'type'=> isset($typeData[$value->type])?$typeData[$value->type]:0, 'check_time'=>strtotime($value->sh_time), - 'state'=>$value->state, + 'state'=>$value->state ?? 0, - 'apply_cash'=>$value->tx_cost, - 'real_cash'=>$value->sj_cost, - 'bank_card'=>$value->yhk_num, - 'bank_info'=>$value->yh_info, + 'apply_cash'=>$value->tx_cost ?? 0, + 'real_cash'=>$value->sj_cost ?? 0, + 'bank_card'=>$value->yhk_num ?? 0, + 'bank_info'=>$value->yh_info ?? 0, - 'created_at' => strtotime($value->time), - 'updated_at' => strtotime($value->sh_time), + 'created_at' => $value->time ? strtotime($value->time) :0, + 'updated_at' => $value->sh_time ? strtotime($value->sh_time) :0, ]; $res = DB::table($newTableName)->insert($newData); diff --git a/app/Console/Commands/OnlineOrderStatis.php b/app/Console/Commands/OnlineOrderStatis.php deleted file mode 100644 index 95efc51..0000000 --- a/app/Console/Commands/OnlineOrderStatis.php +++ /dev/null @@ -1,66 +0,0 @@ -= 1599148800 and `time_add` <=1599235199 and `type` = 1 and state IN (4,5,10)"); - - $totalCount = count($ret); - foreach ($ret as $key => $item) { - - } - - return 0; - } -}