账号登录

This commit is contained in:
2026-03-10 14:25:17 +08:00
parent cb692a8f90
commit 6dbcaecf68
5 changed files with 60 additions and 26 deletions
+7
View File
@@ -46,4 +46,11 @@ class User extends Model
* 不允许自动填充模型字段
*/
protected $guarded = [];
// 账号查询的作用域
public function scopeByAccount($query, $account)
{
return $query->Where('phone', $account)
->orWhere('email', $account);
}
}