61 行
2.2 KiB
PHP
可执行文件
61 行
2.2 KiB
PHP
可执行文件
<?php
|
|
|
|
namespace Common\Model;
|
|
|
|
use Think\Model;
|
|
|
|
//[1.4.46]
|
|
/**
|
|
* 代理商支付权限表
|
|
* Class PayPatternModel
|
|
* @package Common\Model
|
|
*/
|
|
class PayPatternModel extends BaseModel
|
|
{
|
|
/* 定义当前模型对应的数据表
|
|
* */
|
|
protected $tableName = 'retail_pay_pattern';
|
|
/*protected $fields = array(
|
|
'id', //int(10) unsigned NOT NULL AUTO_INCREMENT,
|
|
'agent_id', //int(10) DEFAULT '0' COMMENT '代理商ID',
|
|
'general_pay_name', //varchar(50) DEFAULT '普通支付模式' COMMENT '普通支付模式',
|
|
'general_pay', //tinyint(3) DEFAULT '0' COMMENT '普通支付模式状态 0.关闭 1.开启',
|
|
'service_pay_name', //varchar(50) DEFAULT '服务商支付模式' COMMENT '服务商支付模式',
|
|
'service_pay', //tinyint(3) DEFAULT '0' COMMENT '服务商支付模式状态 0.关闭1.开启',
|
|
'new_continent_pay_name', //varchar(50) DEFAULT '新大陆支付模式' COMMENT '新大陆支付模式',
|
|
'new_continent_pay', //tinyint(3) DEFAULT '0' COMMENT '新大陆支付模式状态0.关闭1.开启',
|
|
);*/
|
|
const ID = 'id';
|
|
const AGENT_ID = 'agent_id';
|
|
const GENERAL_PAY_NAME = 'general_pay_name';
|
|
const GENERAL_PAY = 'general_pay';
|
|
const SERVICE_PAY_NAME = 'service_pay_name';
|
|
const SERVICE_PAY = 'service_pay';
|
|
const CONTINENT_PAY_NAME = 'new_continent_pay_name';
|
|
const CONTINENT_PAY = 'new_continent_pay';
|
|
const CLOUD_PAY = 'cloud_pay';
|
|
|
|
/* 获取代理商支付权限
|
|
* @param $agent_id 代理商id
|
|
* @return array
|
|
* */
|
|
public function get_pay_pattern($agent_id)
|
|
{
|
|
$pay_pattern = $this->getFind(array('agent_id' => $agent_id), 'general_pay,service_pay,new_continent_pay');
|
|
if ($pay_pattern) {
|
|
return $pay_pattern;
|
|
} else {
|
|
return array();
|
|
}
|
|
}
|
|
|
|
/**
|
|
* @param $agent_id
|
|
* @return mixed
|
|
*/
|
|
public function getAgentPattern($agent_id)
|
|
{
|
|
$res = $this->getFind(array($this::AGENT_ID => $agent_id), array($this::GENERAL_PAY, $this::SERVICE_PAY, $this::CONTINENT_PAY,$this::CLOUD_PAY));
|
|
return $res;
|
|
}
|
|
} |