\app\store\serviceOrderService

商城订单服务 Class OrderService

Summary

Methods
Properties
Constants
create()
buildExpressData()
buildOrderList()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
buildOrderData()
No private properties found
N/A

Methods

create()

create(integer  $mid, string  $params, integer  $addressId, integer  $expressId, string  $orderDesc = '', integer  $orderType = 1, string  $from = 'wechat') : array

商城创建订单

Parameters

integer $mid

会员ID

string $params

商品参数规格 (商品ID@商品规格@购买数量;商品ID@商品规格@购买数量)

integer $addressId

地址记录ID

integer $expressId

快递记录ID

string $orderDesc

订单描述

integer $orderType

订单类型

string $from

订单来源

Throws

\think\db\exception\DataNotFoundException
\think\db\exception\ModelNotFoundException
\think\exception\DbException

Returns

array

buildExpressData()

buildExpressData(array  $order, integer  $address_id, integer  $express_id) : array

生成订单快递数据

Parameters

array $order

订单主表记录

integer $address_id

会员地址ID

integer $express_id

快递信息ID

Throws

\think\db\exception\DataNotFoundException
\think\db\exception\ModelNotFoundException
\think\exception\DbException

Returns

array

buildOrderList()

buildOrderList(array  $list) : array

订单主表数据处理

Parameters

array $list

Throws

\think\db\exception\DataNotFoundException
\think\db\exception\ModelNotFoundException
\think\exception\DbException

Returns

array

buildOrderData()

buildOrderData(array  $item, array  $order, array  $orderList, string  $price_field = 'selling_price') : array

订单数据生成

Parameters

array $item

订单单项参数 (mid,type,order_no,goods_id,goods_spec,goods_number)

array $order

订单主表

array $orderList

订单详细表

string $price_field

实际计算单价字段

Throws

\think\db\exception\DataNotFoundException
\think\db\exception\ModelNotFoundException
\think\exception\DbException

Returns

array