input('status','0'); $type = request()->input('coin_id', 1); if($status==2 && $type==3){ $status=[5,6,7,11,12,13,21]; }else{ $status=['1',2,3,4,8,9,10,14,15,20,22]; } $details = MoneyDetails::where('type', $type) ->whereIn('status', $status) ->where('member_id', $this->member->{'id'}) ->orderBy('id', 'desc') ->paginate($size); $data = array(); foreach ($details as $key => $detail) { if ($detail->add_reduce == 2) { $data[$key]['price'] = -$detail->price; // 转出数目 } else { $data[$key]['price'] = $detail->price; // 转出数目 } $data[$key]['remainder'] = $detail->remainder; // 余 $data[$key]['id'] = $detail->id; // 余 if (request()->input('lang', 'zh') == 'zh') { $data[$key]['mark'] = $detail->mark; // 明细 $data[$key]['status_str'] = MoneyDetailServer::$status_map[$detail->status]; } else { $data[$key]['mark'] = $detail->mark_en; // 明细 $data[$key]['status_str'] = MoneyDetailServer::$status_map_en[$detail->status]; } $data[$key]['created_at'] = Carbon::parse($detail->created_at, config('app.timezone'))->format('Y/m/d H:i'); // 时间 } return $this->apiResponseSuccess($data, 'member.yes'); } /** * 获取明细详情 * @return \Illuminate\Http\JsonResponse */ function info() { $id = request()->input('id',1); // withdraw_config $details = MoneyDetails::where('id', $id)->first()->toArray(); $details['coin_name'] = MoneyDetailServer::$type_map[$details['type']]; if (request()->input('lang', 'zh') == 'zh') { $details['status_str'] = MoneyDetailServer::$status_map[$details['status']]; } else { $details['mark'] = $details['mark_en'] ; // 明细 $details['status_str'] = MoneyDetailServer::$status_map_en[$details['status']]; } return $this->apiResponseSuccess($details, 'member.yes'); } }