文件
mashangyoujiu/Application/Common/Model/RetailVipModel.class.php

89 行
3.9 KiB
PHP
可执行文件

此文件含有模棱两可的 Unicode 字符

此文件含有可能会与其他字符混淆的 Unicode 字符。 如果您是想特意这样的,可以安全地忽略该警告。 使用 Escape 按钮显示他们。

<?php
namespace Common\Model;
use Think\Model;
//[1.7.14]
/**
* Class VipModel
* VipModel 删除
* @package Common\Model
*/
class RetailVipModel extends BaseModel
{
protected $tableName = 'retail_vip';
const ID = 'id'; //int(11) NOT NULL AUTO_INCREMENT,
const OPEN_ID = 'openid'; //text COMMENT '用户在公众号的openid',
const MOBILE_PHONE = 'mobile_phone'; //varchar(11) DEFAULT '0' COMMENT '手机号',
const PASSWORD = 'password'; //varchar(20) DEFAULT NULL COMMENT '密码固定6位',
const BALANCE = 'balance'; //decimal(10,2) DEFAULT '0.00' COMMENT '余额',
const MERCHANT_ID = 'merchantid'; //int(11) DEFAULT NULL COMMENT '商户id',
const STORE_ID = 'storeid'; //int(11) DEFAULT NULL COMMENT '门店id 记录在哪个门店注册的会员',
const PLUS_ID = 'plus_id'; //int(11) DEFAULT '0' COMMENT 'plus会员id',
const PLUS_TYPE = 'plus_type'; //tinyint(1) DEFAULT '3' COMMENT '2plus 会员 3常规会员',
const PLUS_STATE = 'plus_state'; //tinyint(1) DEFAULT '2' COMMENT '1.plus会员 正常 2.plus 会员过期',
const GUIDE_ID = 'guideid'; //int(11) DEFAULT NULL COMMENT '导购员id 默认无导购',
const NAME = 'name'; //varchar(30) DEFAULT NULL COMMENT '会员姓名',
const NICK_NAME = 'nickname'; //varchar(50) DEFAULT NULL COMMENT '微信昵称',
const CITY = 'city'; //text COMMENT '城市',
const PROVINCE = 'province'; //text COMMENT '省',
const SEX = 'sex'; //tinyint(1) DEFAULT '1' COMMENT '性别 1男 2女',
const BIRTHDAY = 'birthday'; //varchar(11) DEFAULT NULL COMMENT '生日',
const INTEGRAL = 'integral'; //int(11) DEFAULT '0' COMMENT '积分',
const AVATAR = 'headimgurl'; //text COMMENT '头像',
const GRADE_INTEGRAL = 'grade_integral'; //int(11) DEFAULT '0' COMMENT '等级积分 只增不减',
const ADD_TIME = 'addtime'; //varchar(11) DEFAULT NULL COMMENT '首次注册时间',
const IS_REGISTER = 'is_register'; //tinyint(1) DEFAULT '0' COMMENT '0未激活公众号会员 1已激活',
const IS_PERFECT = 'is_perfect'; //tinyint(1) DEFAULT '0' COMMENT '0未完善资料 1已完善',
const CARD_NUM = 'cardnum'; //text COMMENT '会员卡号',
const CARD_NUM_OLD = 'cardnum_old'; //text COMMENT '旧会员卡号',
const CARD_KEY = 'card_key'; //varchar(255) DEFAULT '0',
const IS_WX_CODE = 'iswxcode'; //tinyint(1) DEFAULT '0' COMMENT '0未添加到微信会员卡 1已添加',
const STATUS = 'status'; //tinyint(1) DEFAULT '1' COMMENT '会员状态;默认1为正常;1:正常会员,2:删除会员 3冻结 4挂失',
const DENSITY_FREE = 'density_free'; //tinyint(1) DEFAULT '2' COMMENT '会员免密支付 1开启 2关闭',
public function getVipXcxUserLink($where, $field, $order = 'vip.addtime desc', $page, $limit)
{
$list = $this->alias('vip')
->field($field)
->where($where)
->order($order)
->page($page, $limit)
->select();
$total = $this->alias('vip')
->where($where)
->count();
$result['list'] = $list;
$result['count'] = $total;
return $result;
}
//获取plus会员信息
public function getPlusInfo($where, $fields = '*', $order = 'v.id desc', $page = 1, $limit = 10)
{
$id_arr = $this->alias('v')
->join('ls_retail_plus_vip as p on p.vip_id=v.id')
->field($fields)
->where($where)
->page($page, $limit)
->order($order)
->select();
return $id_arr;
}
//获取plus会员id集合
public function getPlusCount($where)
{
$count = $this->alias('v')
->join('ls_retail_plus_vip as p on p.vip_id=v.id')
->where($where)
->count();
return $count;
}
}