12345678910111213141516171819202122232425262728293031 |
- <?php
- namespace App\Model;
- use Illuminate\Database\Eloquent\Model;
- class UserChatgptUseRecord extends Model
- {
- protected $table = "jm_user_chatgpt_use_record";
- public $timestamps = false;
- /**
- * 追加字段
- */
- protected $appends = [
- 'mobile'
- ];
- /**
- * 用户手机号
- */
- public function getMobileAttribute($value)
- {
- $value = $this->attributes['uid'] ?? '';
- $user = User::where('uid' , $value)->first();
- return $user->phone ?? '---';
- }
- }
|