123456789101112131415161718192021222324252627282930313233 |
- <?php
- namespace App\Models;
- use Illuminate\Database\Eloquent\Factories\HasFactory;
- use Illuminate\Database\Eloquent\Model;
- class WxUser extends Model
- {
- use HasFactory;
- protected $table = 'wx_user';
- public $timestamps = false;
- protected static $unguarded = true;
- const USER_LOGIN_RDS = 'yhq-smallapp::UserLogin_';
- /**
- * 创建用户
- * */
- public static function createUser($data)
- {
- $userModel = new self;
- $userModel->openid = $data['openid'];
- $userModel->union_id = $data['union_id'];
- $result = $userModel->save();
- return $result ? $userModel->id : false;
- }
- }
|