|
@@ -82,12 +82,17 @@ class UserController extends AuthController
|
|
{
|
|
{
|
|
$user = $this->user;
|
|
$user = $this->user;
|
|
|
|
|
|
- $packteamIds = OrderPack::where('user_id', $user['id'])->pluck('team_id')->toArray();
|
|
|
|
|
|
+ $packteamIds = OrderPack::join('orders', 'order_packs.order_id', '=', 'orders.id')->where('order_packs.user_id', $user['id'])->where('order_packs.end_time', '>', time())->where('orders.payment_status', 2)->pluck('order_packs.team_id')->toArray();
|
|
$teamIds = [];
|
|
$teamIds = [];
|
|
- array_walk_recursive($packteamIds, function ($x) use (&$teamIds) {
|
|
|
|
- $teamIds[] = $x;
|
|
|
|
- });
|
|
|
|
- $teamIds = array_values(array_unique(array_filter($teamIds)));
|
|
|
|
|
|
+ foreach ($packteamIds as $k => $v) {
|
|
|
|
+ if (!empty($v)) {
|
|
|
|
+ $arr = json_decode($v, true);
|
|
|
|
+ if (!empty($arr)) {
|
|
|
|
+ $teamIds = array_merge($teamIds, $arr);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ $teamIds = array_values(array_unique(array_filter(($teamIds))));
|
|
|
|
|
|
$data = TeamDocter::with(['docter.office', 'docter.qualification'])->whereIn('team_id', $teamIds)->paginate();
|
|
$data = TeamDocter::with(['docter.office', 'docter.qualification'])->whereIn('team_id', $teamIds)->paginate();
|
|
|
|
|