UserModel.php 362 B

12345678910111213141516171819
  1. <?php
  2. namespace App\Models;
  3. class UserModel extends BaseModel
  4. {
  5. protected $table = "user";
  6. /**
  7. * 根据公众号openId获取用户
  8. * @param $accountOpenId string 公众号openId
  9. */
  10. public static function findByAccountOpenId($accountOpenId)
  11. {
  12. return self::query()->where("user_open_id",$accountOpenId)->first();
  13. }
  14. }