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

75 行
4.6 KiB
PHP
可执行文件

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

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

<?php
namespace Common\Model;
//[1.7.90]
/**
* 商户表 之后的 MerchantModel.class.php删除
* Class RetailMerchantModel
* @package Common\Model
*/
class RetailMerchantModel extends BaseModel
{
protected $tableName = 'retail_merchant';
const ID = 'id'; //int(11) NOT NULL AUTO_INCREMENT,
const MOBILE = 'mobile'; //varchar(11) DEFAULT NULL COMMENT '商户手机号(登录账号)',
const PASSWORD = 'password'; //varchar(255) DEFAULT NULL COMMENT '商户登录密码',
const BEGIN_TIME = 'begin_time'; //varchar(11) DEFAULT NULL COMMENT '商户账号启用时间',
const END_TIME = 'end_time'; //varchar(11) DEFAULT NULL COMMENT '商户账号过期时间',
const PROVINCE = 'province'; //int(11) DEFAULT NULL COMMENT '商户所在省份(地址id)',
const CITY = 'city'; //int(11) DEFAULT NULL COMMENT '商户所在市(市区id)',
const AREA = 'area'; //int(11) DEFAULT NULL COMMENT '商户所在县区(县区id)',
const ADD_TIME = 'addtime'; //varchar(11) DEFAULT NULL COMMENT '创建时间',
const STATUS = 'status'; //varchar(2) DEFAULT '1' COMMENT '1:正常使用 2:被禁用 3:被删除',
const NAME = 'name'; //varchar(30) DEFAULT NULL COMMENT '商户的名称',
const ADDRESS = 'address'; //text,
const PARTNER_ID = 'partnerid'; //int(11) DEFAULT NULL COMMENT '合伙人id',
const AGENT_ID = 'agentid'; //int(11) DEFAULT NULL COMMENT '代理商id',
const MEAL_ID = 'mealid'; //int(11) DEFAULT NULL COMMENT '套餐id',
const SMALL_PROGRAM_STATE = 'juris'; //varchar(1) DEFAULT '1' COMMENT '1禁用 2开启 小程序功能',
const STORE_NUM = 'storenum'; //int(11) DEFAULT '1' COMMENT '门店数量',
const CONTINENT_RATE = 'merchant_rate'; //decimal(10,6) DEFAULT NULL COMMENT '新大陆进件商家费率',
const NEARBY_STATUS = 'nearby_status'; //tinyint(1) DEFAULT '2' COMMENT '是否直接跳转附近门店 1.开启 2.关闭',
const CUSTOM_RECHARGE_STATE = 'inputrecharge'; //tinyint(1) DEFAULT '1' COMMENT '自定义充值金额:1,开启,2,关闭。',
const VIP_SHOW_STATUS = 'show_all_vip'; //tinyint(1) DEFAULT '2' COMMENT '门店是否显示所有会员 1.显示 2.不显示',(注释将改为,门店显示会员状态 1显示商户下所有会员 2只能显示当前门店的会员)
const OPERATION_VIP = 'operation_vip'; //tinyint(1) DEFAULT '2' COMMENT '门店是否操作所有会员1.可以2.不可以',(注释将改为,门店操作会员状态 1可操作商户下所有会员 2只能操作当前门店的会员)
const AUTO_USE_GRADE = 'auto_read_recharge_grade'; //tinyint(1) DEFAULT '1' COMMENT '自定义充值时,是否自动读取充值档次,1,自动读取(默认设置),2,不读取。',
const SET_CONTINENT_STATE = 'new_continent_status'; //tinyint(1) DEFAULT '0' COMMENT '商户新大陆配置权限0 关闭 1开启',
const EXPRESS_SEARCH_STATE = 'express_search'; //tinyint(1) DEFAULT '2' COMMENT '查询物流信息状态 1开启 2关闭',
const ALI_RATE = 'ali_rate'; //decimal(10,6) DEFAULT NULL COMMENT '支付宝费率',
const WX_RATE = 'wx_rate'; //decimal(10,6) DEFAULT NULL COMMENT '微信费率',
const AGING_CYCLE = 'aging_cycle'; //tinyint(1) DEFAULT '0' COMMENT '分期周期:0.日,1.月',
const AGING_REPAY = 'aging_repay'; //tinyint(1) DEFAULT '0' COMMENT '分期到账:0.关闭,1.开启.',
const AGING_TIME = 'aging_time'; //varchar(20) DEFAULT '' NULL COMMENT '分期到账间隔',
const UNION_PAY_RATE = 'union_pay_rate'; //云闪付费率
/**
* 判断商户是否能正常使用
* @param $id
* @return mixed
*/
public function getFindNormalMerchant($id)
{
$merchant = $this->getFind(array($this::ID => $id, $this::STATUS => array('in', '1,2')));
if (!empty($merchant)) {
if ($merchant[$this::STATUS] == 1) {
$time = time();
//判断商户是否过期
if ($merchant[$this::BEGIN_TIME] < $time && $merchant[$this::END_TIME] > $time) {
$res['status'] = 1;
$res['data'] = $merchant;
} else {
$res['status'] = 0;
$res['msg'] = '未在商户有效期内';
}
} else {
$res['status'] = 0;
$res['msg'] = '商户异常';
}
} else {
$res['status'] = 0;
$res['msg'] = '商户不存在';
}
return $res;
}
}