model = $user; } public function getRandomUserInfo() { return [ ]; } /** * 获取用户状态 * @param $user_id * @return mixed * User: Mead */ public function byIdGetUserStatus($user_id) { return $this->model->where('id', $user_id)->first(); } /** * 是否正常 * @param $user_id * @return mixed * Author: Mead */ public function byIdCheckStatusOk($user_id) { return $this->model->where('id', $user_id)->value('status'); } public function inviteNewRewardBalance($money, $user_id, $logs_id) { // 钱包记录 WalletLog::log(WalletLog::OPERATE_TYPE_ADD, $money, $user_id, WalletLog::TYPE_ADD_INVITE_NEW_TO_WELLET, $this->model->register_area_id, $logs_id, InviteNewUsersGiveGiftLog::class); // 增加余额 $wallet_money = $this->model->wallet_money; $wallet_money = bcadd($wallet_money, $money, 2); $this->model->update(['wallet_money' => $wallet_money]); } /** * 判断免押金卡是否到期 并更新 isDepositCardExpired * * @param $user_id * @return bool false 已过期 | true 正常 * @author Fx * */ public function isDepositCardExpired($user_id) { $user = $this->model->find($user_id); $deposit_expire_time = Carbon::parse($user->deposit_expire_time); if (Carbon::now()->gt($deposit_expire_time)) { //判断第一个日期是否比第二个日期大 $user->is_deposit = User::DEPOSIT_NO; $user->deposit_type = User::DEPOSIT_TYPE_NO; $user->save(); return false; } return true; } }