0
我正嘗試從多家餐館下訂單。當我下訂單時,同樣訂單編號正在數據庫中添加訂單。我想要的是,當用戶從多家餐廳下訂單時,我想爲他們單獨訂購訂單號。來自多家餐廳的訂單的不同訂購ID
這裏是我的代碼:
$order_id = $this->generateNewOrderId();
foreach ($cart_content->rest_item_list as $item)
{
$td_data['order_id'] = $order_id;
$td_data['item_id'] = $item->id;
$i_details = $this->restaurant_menu_items_model->get_item_detail_by_id($item->id);
$td_data['item_name'] = $i_details->name;
$td_data['item_price'] = $i_details->price;
$td_data['item_quantity'] = $item->quantity;
}