|
|
@@ -42,9 +42,8 @@ class PledgeLogic
|
|
|
//添加质抵押订单
|
|
|
public static function setPledgeOrder(object $pledge, array $order_no, int $user_id, int $count, string $pay_type, float $price)
|
|
|
{
|
|
|
- $model = Loader::model('ProductOrder');
|
|
|
$product= self::getOrderProductList($user_id, $order_no, $count);
|
|
|
-
|
|
|
+
|
|
|
if(empty($product) || count($product) < $count) throw new Exception('订单不存在');
|
|
|
$pledge_num = 1;
|
|
|
if($pledge->type_id == ProductPledges::Single) $pledge_num = $count;
|
|
|
@@ -59,6 +58,7 @@ class PledgeLogic
|
|
|
(new LedgerWalletModel())->changeWalletAccount($user_id, $pay_type, -$price, $action, 0);
|
|
|
|
|
|
//修改状态
|
|
|
+ $model = Loader::model('ProductOrder');
|
|
|
return $model->whereIn('order_no', $order_no)->setField('status', $model::Freeze);
|
|
|
}
|
|
|
|
|
|
@@ -191,7 +191,6 @@ class PledgeLogic
|
|
|
//添加用户存储产品
|
|
|
public static function setPledgeProductAdd(object $pledge, int $user_id, int $count, array $order_no)
|
|
|
{
|
|
|
-
|
|
|
$product = self::getOrderProductList($user_id, $order_no, $count);
|
|
|
if(empty($product) || count($product) < $count) throw new Exception('订单不存在');
|
|
|
|