96 行
3.6 KiB
PHP
可执行文件
96 行
3.6 KiB
PHP
可执行文件
<?php
|
|
|
|
namespace Common\Model;
|
|
|
|
use Think\Model;
|
|
//[1.7.90]
|
|
class VipConfigModel extends BaseModel
|
|
{
|
|
protected $tableName = 'vip_config';
|
|
protected $fields = array(
|
|
'id', //int(11) NOT NULL AUTO_INCREMENT,
|
|
'merchantid', //int(11) DEFAULT '0' COMMENT '商户id',
|
|
'vip_detail', //varchar(10000) COMMENT '会员卡详情',
|
|
'addtime', //varchar(13) DEFAULT NULL COMMENT '数据添加时间',
|
|
'signin_give', //int(11) DEFAULT '0' COMMENT '签到一天送的积分',
|
|
'infoscore', //int(11) DEFAULT '0' COMMENT '会员完善资料给与积分。',
|
|
'percent', //decimal(20,6) DEFAULT '0.000000' COMMENT '消费获得积分比例。',
|
|
'percent_state', //tinyint(1) DEFAULT '2' COMMENT '是否开启消费获得积分。1,开启,2,关闭',
|
|
'style_model', //tinyint(1) DEFAULT '1' COMMENT '会员卡模板',
|
|
'recharge_state', //tinyint(1) DEFAULT '2' COMMENT '是否开启充值送积分:1开启 2关闭',
|
|
'recharge_integral', //decimal(20,6) DEFAULT '0.000000' COMMENT '充值赠送积分',
|
|
'viptemplatesign', //varchar(255) DEFAULT '' COMMENT '会员卡模板标识。',
|
|
'plus_signin_give', //int(11) DEFAULT '0' COMMENT 'plus会员签到积分',
|
|
'plus_infoscore', //int(11) DEFAULT '0' COMMENT 'plus会员完善资料给与积分。',
|
|
'plus_percent', //int(11) DEFAULT '0' COMMENT 'plus会员消费获得是常规会员的几倍',
|
|
'plus_percent_state', //tinyint(1) DEFAULT '2' COMMENT '开启plus会员消费送积分 1开启 2关闭',
|
|
'plus_recharge_integral', //int(11) DEFAULT '0' COMMENT '充值获得积分是常规会员的几倍',
|
|
'plus_recharge_state', //tinyint(1) DEFAULT '2' COMMENT 'plus会员开启充值赠送积分 1 开启 2关闭',
|
|
'goods_integral_state', //tinyint(1) DEFAULT '2' COMMENT '1开启 2关闭 常规会员商品单独算积分',
|
|
'goods_integral_plus_state',//tinyint(1) DEFAULT '2' COMMENT '1开启 2关闭 plus会员商品积分',
|
|
'goods_integral_multiple', //int(11) DEFAULT '0' COMMENT 'plus会员是常规会员单个商品积分的倍数',
|
|
);
|
|
|
|
/**
|
|
* 添加
|
|
* @param $data
|
|
* @return mixed
|
|
*/
|
|
public function addOrder($data)
|
|
{
|
|
$res = $this->add($data);
|
|
return $res;
|
|
}
|
|
|
|
/**
|
|
* 更新
|
|
* @param $map
|
|
* @param $save
|
|
* @return mixed
|
|
*/
|
|
public function updateOrder($map, $save)
|
|
{
|
|
$res = $this->where($map)->save($save);
|
|
return $res;
|
|
}
|
|
|
|
/**
|
|
* 获取一条
|
|
* @param $map
|
|
* @param string $field
|
|
* @return mixed
|
|
*/
|
|
public function getFind($map, $field = '*')
|
|
{
|
|
$res = $this->field($field)->where($map)->find();
|
|
return $res;
|
|
}
|
|
|
|
/**
|
|
* @param $map
|
|
* @param string $field
|
|
* @param string $order
|
|
* @param string $page
|
|
* @return mixed
|
|
*/
|
|
public function getSelect($map, $field = '*', $order = 'id asc', $page = '')
|
|
{
|
|
if ($page) {
|
|
$res = $this->field($field)->where($map)->order($order)->page($page)->select();
|
|
} else {
|
|
$res = $this->field($field)->where($map)->order($order)->select();
|
|
}
|
|
return $res;
|
|
}
|
|
|
|
/**
|
|
* 获取数量
|
|
* @param $map
|
|
* @return mixed
|
|
*/
|
|
public function getCount($map)
|
|
{
|
|
$res = $this->where($map)->count();
|
|
return $res;
|
|
}
|
|
} |