where('order_main_id',$oid)->get()->toArray(); if (count($orderData)) { foreach ($orderData as $item) { if (is_object($item)){ $accountData['user_id'] = $item->user_id; $accountData['order_id'] = $item->id; $accountData['store_id'] = $item->store_id; $accountData['money'] = $item->money; $accountData['type'] = $type; $accountData['note'] = $note; $accountData['add_time'] = time(); $accountData['time'] = date('Y-m-d H:i:s', time()); $data[] = $accountData; } } return DB::table('ims_cjdc_store_account')->insert($data); } else { return false; } } }