|
|
@@ -42,9 +42,9 @@ class PledgeLogic
|
|
|
}
|
|
|
|
|
|
//添加质抵押订单
|
|
|
- public static function setPledgeOrder(object $pledge, array $order_no, int $user_id, int $count, string $pay_type, float $price)
|
|
|
+ public static function setPledgeOrder(object $pledge, array $order_id, int $user_id, int $count, string $pay_type, float $price)
|
|
|
{
|
|
|
- $product= self::getOrderProductList($user_id, $order_no, $count);
|
|
|
+ $product= self::getOrderProductList($user_id, $order_id, $count);
|
|
|
|
|
|
if(empty($product) || count($product) < $count) throw new Exception('订单不存在');
|
|
|
$pledge_num = 1;
|
|
|
@@ -60,7 +60,7 @@ class PledgeLogic
|
|
|
if($price >0) Loader::model('LedgerWalletModel')->changeWalletAccount($user_id, $pay_type, -$price, $action, 0);
|
|
|
|
|
|
//修改状态
|
|
|
- return Loader::model('ProductOrder')->whereIn('order_no', $order_no)->setField('status', ProductOrder::Freeze);
|
|
|
+ return Loader::model('ProductOrder')->whereIn('id', $order_id)->setField('status', ProductOrder::Freeze);
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -117,7 +117,6 @@ class PledgeLogic
|
|
|
if(count($orderId) == count($detail)) {
|
|
|
$rows->status = $model::Remove;
|
|
|
}else{
|
|
|
-
|
|
|
$result = [];
|
|
|
foreach ($detail as &$item)
|
|
|
if(!in_array($item['id'], $orderId)) $result[] = $item;
|
|
|
@@ -191,13 +190,13 @@ class PledgeLogic
|
|
|
|
|
|
|
|
|
//添加用户存储产品
|
|
|
- public static function setPledgeProductAdd(object $pledge, int $user_id, int $count, array $order_no)
|
|
|
+ public static function setPledgeProductAdd(object $pledge, int $user_id, int $count, array $order_id)
|
|
|
{
|
|
|
- $product = self::getOrderProductList($user_id, $order_no, $count);
|
|
|
+ $product = self::getOrderProductList($user_id, $order_id, $count);
|
|
|
if(empty($product) || count($product) < $count) throw new Exception('订单不存在');
|
|
|
|
|
|
//修改订单状态
|
|
|
- Loader::model('ProductOrder')::where('user_id', $user_id)->whereIn('order_no', $order_no)->setField('status', ProductOrder::Freeze);
|
|
|
+ Loader::model('ProductOrder')::where('user_id', $user_id)->whereIn('id', $order_id)->setField('status', ProductOrder::Freeze);
|
|
|
|
|
|
//添加产品
|
|
|
$detail = json_decode($pledge->details, true);
|
|
|
@@ -208,12 +207,12 @@ class PledgeLogic
|
|
|
|
|
|
|
|
|
//获取订单产品
|
|
|
- private static function getOrderProductList(int $user_id, array $order_no, int $count)
|
|
|
+ private static function getOrderProductList(int $user_id, array $order_id, int $count)
|
|
|
{
|
|
|
return Loader::model('ProductOrder')::alias('a')
|
|
|
->join('product_list b', 'a.product_id = b.id', 'left')
|
|
|
->where('a.user_id', $user_id)
|
|
|
->where('a.status', ProductOrder::Paid)
|
|
|
- ->whereIn('a.order_no', $order_no)->field('a.id,b.zh_name,b.thum,a.order_no')->limit($count)->select();
|
|
|
+ ->whereIn('a.id', $order_id)->field('a.id,b.zh_name,b.thum,a.order_no')->select();
|
|
|
}
|
|
|
}
|