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

70 行
3.1 KiB
PHP
可执行文件

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

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

<?php
namespace Common\Model;
//[1.6.9]
use Think\Model;
class RetailVipChangeModel extends BaseModel
{
protected $tableName = 'retail_membereditcord';
const ID = 'id'; // int(11) NOT NULL AUTO_INCREMENT,
const MERCHANT_ID = 'merchant_id'; // int(11) DEFAULT '0' COMMENT '商户id',
const STORE_ID = 'store_id'; // int(11) DEFAULT '0' COMMENT '门店id',
const VIP_ID = 'vip_id'; // int(11) DEFAULT '0' COMMENT '会员id',
const OPERATOR = 'operator'; // tinyint(1) DEFAULT '0' COMMENT '操作人员类型 0.无类型(小程序消费、公众号兑换商品...) 1.商户 2.店长 3.收银员',
const OPERATOR_ID = 'operator_id'; // int(11) DEFAULT '0' COMMENT '操作人员id',
const BEFORE_PHONE = 'before_phone'; // varchar(13) DEFAULT '' COMMENT '修改之前的手机号',
const AFTER_PHONE = 'after_phone'; // varchar(13) DEFAULT '' COMMENT '修改之后的手机号',
const BEFORE_BALANCE = 'before_balance'; // decimal(10,2) DEFAULT '0.00' COMMENT '修改之前的余额',
const AFTER_BALANCE = 'after_balance'; // decimal(10,2) DEFAULT NULL COMMENT '修改之后的余额',
const BEFORE_GRADE = 'before_grade'; // varchar(255) DEFAULT '' COMMENT '修改之前的等级',
const AFTER_GRADE = 'after_grade'; // varchar(255) DEFAULT '' COMMENT '修改之后的等级',
const PASSWORD_STATE = 'password_state'; // tinyint(1) DEFAULT '0' COMMENT '是否修改密码 0.未修改 1.修改',
const ADD_TIME = 'add_time'; // varchar(13) DEFAULT '' COMMENT '添加时间',
const BEFORE_CARD_KEY = 'before_card_key'; // varchar(50) DEFAULT '0' COMMENT '实体卡(变更前),
const AFTER_CARD_KEY = 'after_card_key'; // varchar(50) DEFAULT '0' COMMENT '实体卡(变更后),
/**
* 联查 vip
* @param $map
* @param $field
* @param $page
* @param $limit
* @return mixed
*/
public function getLinkSelect($map, $field = '*', $page = '', $limit = '')
{
// 判断是否分页
if ($page && $limit) {
$data = $this->alias('c')
->join('ls_retail_vip as v on c.' . $this::VIP_ID . '=v.id')
->field($field)
->where($map)
->order($this::ADD_TIME . ' desc')
->page($page, $limit)
->select();
} else {
$data = $this->alias('c')
->join('ls_retail_vip as v on c.' . $this::VIP_ID . '=v.id')
->field($field)
->where($map)
->order($this::ADD_TIME . ' desc')
->select();
}
return $data ? $data : array();
}
/**
* 联查,统计 vip
* @param $map
* @return mixed
*/
public function getLinkCount($map)
{
$count = $this->alias('c')
->join('ls_retail_vip as v on c.' . $this::VIP_ID . '=v.id')
->where($map)
->count();
return intval($count);
}
}