oldTable)) { echo $this->oldTable." 不存在 跳过\n"; return; } $newList = \Illuminate\Support\Facades\DB::table($this->newTable)->get(); if($newList->isNotEmpty()){ echo "yz_goods_share 已经有数据了跳过\n"; return ; } $list = \Illuminate\Support\Facades\DB::table($this->oldTable)->get(); if($list) { foreach ($list as $v) { \Illuminate\Support\Facades\DB::table($this->newTable)->insert([ 'goods_id'=> $v['id'], 'need_follow'=> $v['needfollow'], 'no_follow_message'=> $v['followtip'], 'follow_message'=> $v['followurl'], 'share_title'=> $v['share_title'], 'share_thumb'=> $v['share_icon'], 'share_desc'=> $v['description'], ]); } } } }