...
|
...
|
@@ -567,16 +567,28 @@ class CartModel |
|
|
* @param int $paymentId 支付方式ID
|
|
|
* @param int $paymentType 支付类型ID
|
|
|
* @param string $remark 留言
|
|
|
* @param string $couponCode 优惠券码
|
|
|
* @param mixed $yohoCoin 使用的YOHO币数量或为空
|
|
|
* @return array 接口返回的数据
|
|
|
*/
|
|
|
public static function orderSub($uid, $addressId, $cartType, $deliveryTime, $deliveryWay, $invoiceTitle, $invoiceId, $paymentId, $paymentType, $remark, $yohoCoin)
|
|
|
public static function orderSub($uid, $addressId, $cartType, $deliveryTime, $deliveryWay, $invoiceTitle, $invoiceId, $paymentId, $paymentType, $remark, $couponCode, $yohoCoin)
|
|
|
{
|
|
|
$result = array();
|
|
|
|
|
|
$orderSubRes = CartData::orderSub($uid, $addressId, $cartType, $deliveryTime, $deliveryWay, $invoiceTitle, $invoiceId, $paymentId, $paymentType, $remark, $yohoCoin);
|
|
|
if ($orderSubRes && isset($orderSubRes['code'])) {
|
|
|
$result = $orderSubRes;
|
|
|
$result = array('code' => 400, 'message' => '出错啦');
|
|
|
|
|
|
if (empty($addressId)) {
|
|
|
$result['code'] = 401;
|
|
|
$result['message'] = '配送地址不能为空';
|
|
|
} elseif (empty($deliveryTime)) {
|
|
|
$result['code'] = 402;
|
|
|
$result['message'] = '请选择配送时间';
|
|
|
} elseif (empty($deliveryWay)) {
|
|
|
$result['code'] = 403;
|
|
|
$result['message'] = '请选择配送方式';
|
|
|
} else {
|
|
|
$orderSubRes = CartData::orderSub($uid, $addressId, $cartType, $deliveryTime, $deliveryWay, $invoiceTitle, $invoiceId, $paymentId, $paymentType, $remark, $couponCode, $yohoCoin);
|
|
|
if ($orderSubRes && isset($orderSubRes['code'])) {
|
|
|
$result = $orderSubRes;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return $result;
|
...
|
...
|
|