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

52 行
1.9 KiB
PHP
可执行文件

<?php
namespace Common\Model;
//[1.7.90]
class RetailPlusVipModel extends BaseModel
{
protected $tableName = 'retail_plus_vip';
const ID = 'id'; //int(11) NOT NULL AUTO_INCREMENT,
const VIP_ID = 'vip_id'; //int(11) DEFAULT '0' COMMENT '常规会员表id',
const XCX_VIP_ID = 'xcx_vip_id'; //varchar(255) DEFAULT '0' COMMENT '普通成员id',
const MERCHANT_ID = 'merchantid'; //int(11) DEFAULT '0' COMMENT '商户id',
const STORE_ID = 'storeid'; //int(11) DEFAULT '0' COMMENT '门店id',
const ADD_TIME = 'addtime'; // varchar(13) DEFAULT '' COMMENT '添加时间',
const START_TIME = 'start_time'; //varchar(13) DEFAULT NULL COMMENT '开始时间',
const END_TIME = 'end_time'; // varchar(13) DEFAULT '' COMMENT '到期时间',
const STATE = 'state'; //tinyint(1) DEFAULT '1' COMMENT '1正常 2过期',
public function getPlusInfoList($where, $page, $limit)
{
$list = $this->alias('p')
->join('ls_retail_vip as v on p.vip_id=v.id')
->join('ls_retail_store as s on p.storeid=s.id', 'LEFT')
->where($where)
->page($page, $limit)
->order('p.id desc')
->field('p.*,v.mobile_phone,v.balance,v.integral,v.birthday,v.name,v.nickname,v.status,s.storetag as store_name,v.card_key,v.guideid')
->select();
return $list ? $list : [];
}
public function getPlusInfoTotal($where)
{
$list = $this->alias('p')
->join('ls_retail_vip as v on p.vip_id=v.id')
->where($where)
->field('v.balance,v.integral')
->select();
return $list ? $list : [];
}
public function getPlusInfoCount($where)
{
$count = $this->alias('p')
->join('ls_retail_vip as v on p.vip_id=v.id')
->where($where)
->count();
return $count ? $count : 0;
}
}