const system = require("../../../system");
const Dao = require("../../dao.base");
class SaasMerchantAppUserDao extends Dao {
  constructor() {
    super(Dao.getModelName(SaasMerchantAppUserDao));
  }

  async byOpenId(openid, saasMerchantId) {
    var sql = "SELECT * FROM uc_user WHERE openid = :openid AND saas_merchant_id = :saasMerchantId AND deleted_at IS NULL";
    var list = await this.customQuery(sql, {
      openid: openid,
      saasMerchantId: saasMerchantId,
    });
    if (!list || list.length == 0) {
      return null;
    }
    return list[0];
  }

}
module.exports = SaasMerchantAppUserDao;