|
@@ -3,6 +3,7 @@
|
|
|
namespace app\api\controller\user;
|
|
|
|
|
|
use app\http\validates\user\AddressValidate;
|
|
|
+use app\models\store\StoreCart;
|
|
|
use app\models\store\StoreService;
|
|
|
use app\models\system\Card;
|
|
|
use app\models\system\CardInfo;
|
|
@@ -81,6 +82,19 @@ class UserController
|
|
|
$info['store_name'] = [];
|
|
|
}
|
|
|
$info['lock_group_award'] = UserBill::where(['type' => 'brokerage', 'category' => 'now_money', 'pm' => 1, 'status' => 0, 'uid' => $info['uid'], 'title' => '套装极差奖'])->sum('number');
|
|
|
+
|
|
|
+ $orders = StoreOrder::where('paid', 1)
|
|
|
+ ->where('uid', $info['uid'])
|
|
|
+ ->where('refund_status', 0)
|
|
|
+ ->where('is_del', 0)
|
|
|
+ ->where('is_system_del', 0)->select();
|
|
|
+ $carts = [];
|
|
|
+ foreach ($orders as $v) {
|
|
|
+ $carts = array_merge($carts, $v['cart_id']);
|
|
|
+ }
|
|
|
+ $num = StoreCart::where('id', 'in', $carts)->where('is_suit', 1)->field('sum(cart_num) as cart_num_sum')->find()['cart_num_sum'];
|
|
|
+ $info['suit_num'] = $num ?: 0;
|
|
|
+
|
|
|
return app('json')->success($info);
|
|
|
}
|
|
|
|
|
@@ -179,6 +193,18 @@ class UserController
|
|
|
$user['switchUserInfo'][] = $request->user();
|
|
|
}
|
|
|
|
|
|
+ $orders = StoreOrder::where('paid', 1)
|
|
|
+ ->where('uid', $user['uid'])
|
|
|
+ ->where('refund_status', 0)
|
|
|
+ ->where('is_del', 0)
|
|
|
+ ->where('is_system_del', 0)->select();
|
|
|
+ $carts = [];
|
|
|
+ foreach ($orders as $v) {
|
|
|
+ $carts = array_merge($carts, $v['cart_id']);
|
|
|
+ }
|
|
|
+ $num = StoreCart::where('id', 'in', $carts)->where('is_suit', 1)->field('sum(cart_num) as cart_num_sum')->find()['cart_num_sum'];
|
|
|
+ $user['suit_num'] = $num ?: 0;
|
|
|
+
|
|
|
return app('json')->successful($user);
|
|
|
}
|
|
|
|