|
@@ -83,7 +83,7 @@ class WechatMinprogramUserService
|
|
* @param int $uid
|
|
* @param int $uid
|
|
* date 2023/05/19 14:57
|
|
* date 2023/05/19 14:57
|
|
*/
|
|
*/
|
|
- public static function getUserOrderList(int $uid)
|
|
|
|
|
|
+ public static function getUserOrderList(int $uid, $param)
|
|
{
|
|
{
|
|
$pool = [
|
|
$pool = [
|
|
'MONTH' => '包月',
|
|
'MONTH' => '包月',
|
|
@@ -93,8 +93,15 @@ class WechatMinprogramUserService
|
|
$list = Order::join('pay_products', 'pay_products.id', '=', 'orders.pay_product_id')
|
|
$list = Order::join('pay_products', 'pay_products.id', '=', 'orders.pay_product_id')
|
|
->select('orders.price', 'orders.trade_no', "orders.video_id", 'orders.pay_end_at', 'pay_products.type', 'pay_products.price as product_price', 'pay_products.given')
|
|
->select('orders.price', 'orders.trade_no', "orders.video_id", 'orders.pay_end_at', 'pay_products.type', 'pay_products.price as product_price', 'pay_products.given')
|
|
->where('orders.status', 'PAID')
|
|
->where('orders.status', 'PAID')
|
|
- ->where('orders.uid', $uid)
|
|
|
|
- ->orderBy('orders.id', 'desc')
|
|
|
|
|
|
+ ->where('orders.uid', $uid);
|
|
|
|
+ if (getProp($param, 'puser_id', 0) > 0) {
|
|
|
|
+ $list->where('orders.puser_id', $param['puser_id']);
|
|
|
|
+ }
|
|
|
|
+ if (getProp($param, 'user_id', 0) > 0) {
|
|
|
|
+ $list->where('orders.user_id', $param['user_id']);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $list->orderBy('orders.id', 'desc')
|
|
->paginate(15);
|
|
->paginate(15);
|
|
|
|
|
|
foreach ($list as $item) {
|
|
foreach ($list as $item) {
|