|
|
@@ -210,10 +210,10 @@ class Order extends Api
|
|
|
$order_info = $productOrder->where('id', $params['order_id'])->where('status', $productOrder::Paid)->find();
|
|
|
if(empty($order_info)) throw new Exception(__("参数有误,无可用产品"));
|
|
|
|
|
|
-
|
|
|
$user = $userModel->getByAddress($params['address']);
|
|
|
if(empty($user)) throw new Exception(__("赠送用户不存在"));
|
|
|
-
|
|
|
+ if($user['id'] == $this->auth->id) throw new Exception(__("赠送用户不能是自己"));
|
|
|
+
|
|
|
$chabao = $ledgerWalletModel::getWalletChaBao($this->auth->id);
|
|
|
$fees = bcmul($order_info['price'], getConfig('giveaway'), 2);
|
|
|
if(bccomp($fees, $chabao, 2) > 0) throw new Exception(__("余额不足请前往充值"));
|