订购
> id
> currency_code
> ex_rate_with_base
>状态
> total_in_base_currency
>状态
货币
> currency_code
>符号
> currency_name
> currency_value
> ex_rate_with_base
>状态
订单
> id
> order_id
> product_code
>数量
> unit_price_in_base_currency
>状态
我想要以下输出:
这里我想使用eloquent将order表的ex_rate_with_base字段与order_list表的unit_price相乘.
解决方法:
我想你可以试试这个:
DB::table('order')
->select(DB::raw('(order.ex_rate_with_base * order_list.unit_price_in_base_currency) as orderRate'))
->leftjoin('order_list','order_list.order_id','=','order.id)
->get();
希望这对你有用!!!
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。