module.exports = class extends think.Model {
  get tableName() {
    return 'wechat_user';
  }

  /**
   * 根据 openid + app_remark 查找用户
   */
  async findByOpenId(openId, appRemark) {
    return this.where({ open_id: openId, app_remark: appRemark }).find();
  }

  /**
   * 创建微信用户
   */
  async createUser(data) {
    return this.add(data);
  }
};
