大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。
Jetbrains全系列IDE使用 1年只要46元 售后保障 童叟无欺
<?php
namespace Admin\Controller;
use Common\Controller\AdminController;
use Lib\Utils;
class BusinessController extends AdminController
{
public function __construct()
{
parent::__construct();
C(‘TMPL_L_DELIM’, ‘{chenzhi:’);
C(‘TMPL_R_DELIM’, ‘}’);
}
public function index()
{
$TraceModel = D(‘TraceSelect’);
$businessService = \Lib\Utils::getService(‘Business’);
$businessModel = $businessService->model;
$where = array();
$joinOneStr = ‘posp_business_info ON posp_business.id = posp_business_info.business_id’;
$joinTwoStr = ‘posp_agent ON posp_business.agent_id = posp_agent.id’;
$joinThreeStr = ‘posp_agent_info ON posp_business.agent_id = posp_agent_info.agent_id’;
$agent_user = session(‘admin_user’);
if ($agent_user[‘role_id’] == ’27’) {
$agentIdStr = ”;
$agentList = D(‘Agent’)->field(“id”)->where(array(“role_user_id” => $agent_user[‘agent_id’], “pid” => 7))->select();
if ($agentList) {
foreach ($agentList as $agentListKey => $agentListValue) {
$agentIdStr .= $agentListValue[‘id’] . “,”;
$agentLevelList = D(‘AgentLevel’)->field(“child_agent_id”)->where(array(“agent_id” => $agentListValue[‘id’]))->select();
if ($agentLevelList) {
foreach ($agentLevelList as $agentLevelListKey => $agentLevelListValue) {
$agentIdStr .= $agentLevelListValue[‘child_agent_id’] . “,”;
}
}
}
if ($agentIdStr) {
$agentIdStrArr = explode(“,”, $agentIdStr);
foreach ($agentIdStrArr as $agentIdStrArrKey => $agentIdStrArrValue) {
if ($agentIdStrArrValue) {
$agentIdsArr[] = $agentIdStrArrValue;
}
}
}
}
$where[‘posp_agent.id’] = array(‘in’, implode(‘,’, $agentIdsArr));
}
if (I(‘serial_no’)) {
$where[‘posp_business.serial_no’] = I(‘serial_no’);
}
if (I(‘agent_serial_no’)) {
$agentService = \Lib\Utils::getService(‘Agent’);
$agentInfo = $agentService->getAgentInfoByNo(I(‘agent_serial_no’));
$agentIdArr[] = $agentInfo[‘id’];
$agentLevelModel = D(‘AgentLevel’);
$agentLevelList = $agentLevelModel->where(array(‘agent_id’ => $agentInfo[‘id’]))->select();
foreach ($agentLevelList as $agentLevel) {
$agentIdArr[] = $agentLevel[‘child_agent_id’];
}
$where[‘posp_business.agent_id’] = array(‘in’, implode(‘,’, $agentIdArr));
}
if (I(‘company_name’)) {
$company_name = urldecode(I(‘company_name’));
$where[‘posp_business_info.company_name’] = array(‘like’, ‘%’ . $company_name . ‘%’);
}
if (I(‘status’) != ”) {
$where[‘posp_business.status’] = I(‘status’);
}
if (I(‘industry_id’)) {
$where[‘posp_business_info.industry_id’] = I(‘industry_id’);
}
if (I(‘rate_set_id’)) {
$where[‘posp_business.rate_set_id’] = I(‘rate_set_id’);
}
if (I(‘address’)) {
$addressArr = I(‘address’);
if (count($addressArr) < 2) {
$this->errorPage(‘地址信息未填写完善,请确定后再提交.’);
}
//$province_id = $addressArr[0];
//$city_id = $addressArr[1];
//$town_id = $addressArr[2]?$addressArr[2]:0;
if (($addressArr[0] != 0) && ($addressArr[1] == 0) && ($addressArr[2] == 0)) {
$where[‘posp_business.province_id’] = $addressArr[0];
} elseif (($addressArr[0] != 0) && ($addressArr[1] != 0) && ($addressArr[2] == 0)) {
$where[‘posp_business.province_id’] = $addressArr[0];
$where[‘posp_business.city_id’] = $addressArr[1];
} elseif (($addressArr[0] != 0) && ($addressArr[1] != 0) && ($addressArr[2] != 0)) {
$where[‘posp_business.province_id’] = $addressArr[0];
$where[‘posp_business.city_id’] = $addressArr[1];
$where[‘posp_business.town_id’] = $addressArr[2];
}
}
//导出EXCEL
if (I(‘exportbusiness’) == ‘个人’) {
$this->exportExcelBusinessWFT($where);
}
if(I(‘exportbusiness’) == ‘商户’){
$this->exportExcelBusinessWFTPersonal($where);
}
$count = $businessModel->join($joinOneStr)->join($joinTwoStr)->where($where)->count();
$Page = new \Think\PageBoot($count, 10); // 实例化分页类 传入总记录数和每页显示的记录数(25)
$show = $Page->show(); // 分页显示输出
// 进行分页数据查询 注意limit方法的参数要使用Page类的属性
$businessList = $businessModel->field(‘posp_business.*,posp_business_info.*,posp_agent.username as agent_name,posp_agent_info.company_name as agent_company_name,posp_agent_info.serial_no as agent_serial_no’)->join($joinOneStr, ‘left’)->join($joinTwoStr, ‘left’)->join($joinThreeStr, ‘left’)->where($where)->order(‘posp_business.id desc’)->limit($Page->firstRow . ‘,’ . $Page->listRows)->select();
$businessStatus = $businessService->businessStatus;
$addressService = \Lib\Utils::getService(‘Address’);
//$addressList = $addressService->getAllAddressList();
$addressModel = D(‘Address’);
$proAddressList = $addressModel->getChildAddressByIdCache(0);
$industryModel = D(‘Industry’);
$industryList = $industryModel->where(array(“status” => 1))->order(“sort DESC”)->getField(‘id,name’);
$rate_setModel = D(‘RateSet’);
$rate_setList = $rate_setModel->order(“id DESC”)->getField(‘id,rate_name’);
//$fwcShopModel = new \Common\Model\Fwc\CompanyModel();
//查询同一平台中的开店信息
$TraceModel = D(‘TraceSelect’);
foreach ($businessList as $businesskey => $businessvalue) {
$alipayWhere[‘business_id’] = $businessvalue[‘business_id’];
$alipayWhere[‘dynamic_type’] = array(‘in’, ‘0,2,4’);
$isAlipayTrace = $TraceModel->field(‘trace_id’)->where($alipayWhere)->find();
$businessList[$businesskey][‘showAlipayTrace’] = “0”;
if ($isAlipayTrace[‘trace_id’]) {
$businessList[$businesskey][‘showAlipayTrace’] = “1”;
}
$weixinWhere[‘business_id’] = $businessvalue[‘business_id’];
$weixinWhere[‘dynamic_type’] = 1;
$isWeixinTrace = $TraceModel->field(‘trace_id’)->where($weixinWhere)->find();
$businessList[$businesskey][‘showWeixinTrace’] = “0”;
if ($isWeixinTrace[‘trace_id’]) {
$businessList[$businesskey][‘showWeixinTrace’] = “1”;
}
//商户昨日支付宝交易额
//S(date(“Y-m-d”).”yesterday_alipay_”.$businessvalue[‘business_id’],null) ;
if (!S(date(“Y-m-d”) . “yesterday_alipay_” . $businessvalue[‘business_id’])) {
$yesterdayAlipayWhere[‘business_id’] = $businessvalue[‘business_id’];
$yesterdayAlipayWhere[‘trans_status’] = 1;
$yesterdayAlipayWhere[‘dynamic_type’] = array(‘in’, ‘0,2,4’);
$yesterdayAlipayWhere[‘trans_begin’] = array(array(‘egt’, date(“Y-m-d 00:00:00”, strtotime(“-1 days”))), array(‘elt’, date(“Y-m-d 23:59:59”, strtotime(“-1 days”))), ‘and’);
$yesterdayAlipayTrace = $TraceModel->field(“IFNULL(SUM(total_fee),0.00) as total_fee,IFNULL(COUNT(*),0) as total_count”)->where($yesterdayAlipayWhere)->select();
S(date(“Y-m-d”) . “yesterday_alipay_” . $businessvalue[‘business_id’], $yesterdayAlipayTrace[0], 86400);
}
$yesterday_alipay = S(date(“Y-m-d”) . “yesterday_alipay_” . $businessvalue[‘business_id’]);
$businessList[$businesskey][‘yesterday_alipay’] = $yesterday_alipay[‘total_fee’];
$businessList[$businesskey][‘yesterday_alipay_count’] = $yesterday_alipay[‘total_count’];
//商户昨日微信交易额
//S(date(“Y-m-d”).”yesterday_weixin_”.$businessvalue[‘business_id’],null) ;
if (!S(date(“Y-m-d”) . “yesterday_weixin_” . $businessvalue[‘business_id’])) {
$yesterdayWeixinWhere[‘business_id’] = $businessvalue[‘business_id’];
$yesterdayWeixinWhere[‘trans_status’] = 1;
$yesterdayWeixinWhere[‘dynamic_type’] = 1;
$yesterdayWeixinWhere[‘trans_begin’] = array(array(‘egt’, date(“Y-m-d 00:00:00”, strtotime(“-1 days”))), array(‘elt’, date(“Y-m-d 23:59:59”, strtotime(“-1 days”))), ‘and’);
$yesterdayWeixinTrace = $TraceModel->field(“IFNULL(SUM(total_fee),0.00) as total_fee,IFNULL(COUNT(*),0) as total_count”)->where($yesterdayWeixinWhere)->select();
S(date(“Y-m-d”) . “yesterday_weixin_” . $businessvalue[‘business_id’], $yesterdayWeixinTrace[0], 86400);
}
$yesterday_weixin = S(date(“Y-m-d”) . “yesterday_weixin_” . $businessvalue[‘business_id’]);
$businessList[$businesskey][‘yesterday_weixin’] = $yesterday_weixin[‘total_fee’];
$businessList[$businesskey][‘yesterday_weixin_count’] = $yesterday_weixin[‘total_count’];
//商户昨日支付宝退款额
//S(date(“Y-m-d”).”yesterday_refund_alipay_”.$businessvalue[‘business_id’],null) ;
if (!S(date(“Y-m-d”) . “yesterday_refund_alipay_” . $businessvalue[‘business_id’])) {
$yesterdayRefundAlipayWhere[‘business_id’] = $businessvalue[‘business_id’];
$yesterdayRefundAlipayWhere[‘trans_status’] = 3;
$yesterdayRefundAlipayWhere[‘dynamic_type’] = array(‘in’, ‘0,2,4’);
$yesterdayRefundAlipayWhere[‘trans_begin’] = array(array(‘egt’, date(“Y-m-d 00:00:00”, strtotime(“-1 days”))), array(‘elt’, date(“Y-m-d 23:59:59”, strtotime(“-1 days”))), ‘and’);
$yesterdayRefundAlipayTrace = $TraceModel->field(“IFNULL(SUM(total_fee),0.00) as total_fee,IFNULL(COUNT(*),0) as total_count”)->where($yesterdayRefundAlipayWhere)->select();
S(date(“Y-m-d”) . “yesterday_refund_alipay_” . $businessvalue[‘business_id’], $yesterdayRefundAlipayTrace[0], 86400);
}
$yesterday_refund_alipay = S(date(“Y-m-d”) . “yesterday_refund_alipay_” . $businessvalue[‘business_id’]);
$businessList[$businesskey][‘yesterday_refund_alipay’] = $yesterday_refund_alipay[‘total_fee’];
$businessList[$businesskey][‘yesterday_refund_alipay_count’] = $yesterday_refund_alipay[‘total_count’];
//商户昨日微信退款额
//S(date(“Y-m-d”).”yesterday_refund_weixin_”.$businessvalue[‘business_id’],null) ;
if (!S(date(“Y-m-d”) . “yesterday_refund_weixin_” . $businessvalue[‘business_id’])) {
$yesterdayRefundWeixinWhere[‘business_id’] = $businessvalue[‘business_id’];
$yesterdayRefundWeixinWhere[‘trans_status’] = 3;
$yesterdayRefundWeixinWhere[‘dynamic_type’] = 1;
$yesterdayRefundWeixinWhere[‘trans_begin’] = array(array(‘egt’, date(“Y-m-d 00:00:00”, strtotime(“-1 days”))), array(‘elt’, date(“Y-m-d 23:59:59”, strtotime(“-1 days”))), ‘and’);
$yesterdayRefundWeixinTrace = $TraceModel->field(“IFNULL(SUM(total_fee),0.00) as total_fee,IFNULL(COUNT(*),0) as total_count”)->where($yesterdayRefundWeixinWhere)->select();
S(date(“Y-m-d”) . “yesterday_refund_weixin_” . $businessvalue[‘business_id’], $yesterdayRefundWeixinTrace[0], 86400);
}
$yesterday_refund_weixin = S(date(“Y-m-d”) . “yesterday_refund_weixin_” . $businessvalue[‘business_id’]);
$businessList[$businesskey][‘yesterday_refund_weixin’] = $yesterday_refund_weixin[‘total_fee’];
$businessList[$businesskey][‘yesterday_refund_weixin_count’] = $yesterday_refund_weixin[‘total_count’];
//商户本周支付宝交易额
//S(date(“Y-m-d”).”week_alipay_”.$businessvalue[‘business_id’],null) ;
if (!S(date(“Y-m-d”) . “week_alipay_” . $businessvalue[‘business_id’])) {
$weekAlipayWhere[‘business_id’] = $businessvalue[‘business_id’];
$weekAlipayWhere[‘trans_status’] = 1;
$weekAlipayWhere[‘dynamic_type’] = array(‘in’, ‘0,2,4’);
$weekAlipayWhere[‘trans_begin’] = array(“egt”, date(“Y-m-d H:i:s”, strtotime(“-1 week”)));
$weekAlipayTrace = $TraceModel->field(“IFNULL(SUM(total_fee),0.00) as total_fee,IFNULL(COUNT(*),0) as total_count”)->where($weekAlipayWhere)->select();
S(date(“Y-m-d”) . “week_alipay_” . $businessvalue[‘business_id’], $weekAlipayTrace[0], 86400);
}
$week_alipay = S(date(“Y-m-d”) . “week_alipay_” . $businessvalue[‘business_id’]);
$businessList[$businesskey][‘week_alipay’] = $week_alipay[‘total_fee’];
$businessList[$businesskey][‘week_alipay_count’] = $week_alipay[‘total_count’];
//商户本周微信交易额
//S(date(“Y-m-d”).”week_weixin_”.$businessvalue[‘business_id’],null) ;
if (!S(date(“Y-m-d”) . “week_weixin_” . $businessvalue[‘business_id’])) {
$weekWeixinWhere[‘business_id’] = $businessvalue[‘business_id’];
$weekWeixinWhere[‘trans_status’] = 1;
$weekWeixinWhere[‘dynamic_type’] = 1;
$weekWeixinWhere[‘trans_begin’] = array(“egt”, date(“Y-m-d H:i:s”, strtotime(“-1 week”)));
$weekWeixinTrace = $TraceModel->field(“IFNULL(SUM(total_fee),0.00) as total_fee,IFNULL(COUNT(*),0) as total_count”)->where($weekWeixinWhere)->select();
S(date(“Y-m-d”) . “week_weixin_” . $businessvalue[‘business_id’], $weekWeixinTrace[0], 86400);
}
$week_weixin = S(date(“Y-m-d”) . “week_weixin_” . $businessvalue[‘business_id’]);
$businessList[$businesskey][‘week_weixin’] = $week_weixin[‘total_fee’];
$businessList[$businesskey][‘week_weixin_count’] = $week_weixin[‘total_count’];
//商户本月支付宝交易额
//S(date(“Y-m-d”).”month_alipay_”.$businessvalue[‘business_id’],null) ;
if (!S(date(“Y-m-d”) . “month_alipay_” . $businessvalue[‘business_id’])) {
$monthAlipayWhere[‘business_id’] = $businessvalue[‘business_id’];
$monthAlipayWhere[‘trans_status’] = 1;
$monthAlipayWhere[‘dynamic_type’] = array(‘in’, ‘0,2,4’);
$monthAlipayWhere[‘trans_begin’] = array(“egt”, date(“Y-m-d H:i:s”, strtotime(“-1 months”)));
$monthAlipayTrace = $TraceModel->field(“IFNULL(SUM(total_fee),0.00) as total_fee,IFNULL(COUNT(*),0) as total_count”)->where($monthAlipayWhere)->select();
S(date(“Y-m-d”) . “month_alipay_” . $businessvalue[‘business_id’], $monthAlipayTrace[0], 86400);
}
$month_alipay = S(date(“Y-m-d”) . “month_alipay_” . $businessvalue[‘business_id’]);
$businessList[$businesskey][‘month_alipay’] = $month_alipay[‘total_fee’];
$businessList[$businesskey][‘month_alipay_count’] = $month_alipay[‘total_count’];
//商户本月微信交易额
//S(date(“Y-m-d”).”month_weixin_”.$businessvalue[‘business_id’],null) ;
if (!S(date(“Y-m-d”) . “month_weixin_” . $businessvalue[‘business_id’])) {
$monthWeixinWhere[‘business_id’] = $businessvalue[‘business_id’];
$monthWeixinWhere[‘trans_status’] = 1;
$monthWeixinWhere[‘dynamic_type’] = 1;
$monthWeixinWhere[‘trans_begin’] = array(“egt”, date(“Y-m-d H:i:s”, strtotime(“-1 months”)));
$monthWeixinTrace = $TraceModel->field(“IFNULL(SUM(total_fee),0.00) as total_fee,IFNULL(COUNT(*),0) as total_count”)->where($monthWeixinWhere)->select();
S(date(“Y-m-d”) . “month_weixin_” . $businessvalue[‘business_id’], $monthWeixinTrace[0], 86400);
}
$month_weixin = S(date(“Y-m-d”) . “month_weixin_” . $businessvalue[‘business_id’]);
$businessList[$businesskey][‘month_weixin’] = $month_weixin[‘total_fee’];
$businessList[$businesskey][‘month_weixin_count’] = $month_weixin[‘total_count’];
//POSP_CASH_BUSINESS
$businessList[$businesskey][‘amount_fee’] = ‘0.00’;
$businessList[$businesskey][‘amount_count’] = ‘0’;
$businessList[$businesskey][‘rates_fee’] = ‘0.00’;
$businessList[$businesskey][‘refund_fee’] = ‘0.00’;
$businessList[$businesskey][‘refund_count’] = ‘0’;
$businessList[$businesskey][‘real_fee’] = ‘0.00’;
$businessList[$businesskey][‘cashget_fee’] = ‘0.00’;
$businessList[$businesskey][‘cashget_count’] = ‘0’;
$businessList[$businesskey][‘amount_wx’] = ‘0.00’;
$businessList[$businesskey][‘rates_wx’] = ‘0.00’;
$businessList[$businesskey][‘refund_wx’] = ‘0.00’;
$businessList[$businesskey][‘real_wx’] = ‘0.00’;
$businessList[$businesskey][‘amount_zfb’] = ‘0.00’;
$businessList[$businesskey][‘rates_zfb’] = ‘0.00’;
$businessList[$businesskey][‘real_zfb’] = ‘0.00’;
$businessList[$businesskey][‘refund_zfb’] = ‘0.00’;
$cashBusiness = “”;
$cashBusiness = D(‘CashBusiness’)->where(array(“business_id” => $businessvalue[‘business_id’]))->find();
if ($cashBusiness[‘amount_fee’]) {
$businessList[$businesskey][‘amount_fee’] = $cashBusiness[‘amount_fee’];
}
if ($cashBusiness[‘amount_count’]) {
$businessList[$businesskey][‘amount_count’] = $cashBusiness[‘amount_count’];
}
if ($cashBusiness[‘rates_fee’]) {
$businessList[$businesskey][‘rates_fee’] = $cashBusiness[‘rates_fee’];
}
if ($cashBusiness[‘refund_fee’]) {
$businessList[$businesskey][‘refund_fee’] = $cashBusiness[‘refund_fee’];
}
if ($cashBusiness[‘refund_count’]) {
$businessList[$businesskey][‘refund_count’] = $cashBusiness[‘refund_count’];
}
if ($cashBusiness[‘real_fee’]) {
$businessList[$businesskey][‘real_fee’] = $cashBusiness[‘real_fee’];
}
if ($cashBusiness[‘cashget_fee’]) {
$businessList[$businesskey][‘cashget_fee’] = $cashBusiness[‘cashget_fee’];
}
if ($cashBusiness[‘cashget_count’]) {
$businessList[$businesskey][‘cashget_count’] = $cashBusiness[‘cashget_count’];
}
if ($cashBusiness[‘amount_wx’]) {
$businessList[$businesskey][‘amount_wx’] = $cashBusiness[‘amount_wx’];
}
if ($cashBusiness[‘rates_wx’]) {
$businessList[$businesskey][‘rates_wx’] = $cashBusiness[‘rates_wx’];
}
if ($cashBusiness[‘refund_wx’]) {
$businessList[$businesskey][‘refund_wx’] = $cashBusiness[‘refund_wx’];
}
if ($cashBusiness[‘real_wx’]) {
$businessList[$businesskey][‘real_wx’] = $cashBusiness[‘real_wx’];
}
if ($cashBusiness[‘amount_zfb’]) {
$businessList[$businesskey][‘amount_zfb’] = $cashBusiness[‘amount_zfb’];
}
if ($cashBusiness[‘rates_zfb’]) {
$businessList[$businesskey][‘rates_zfb’] = $cashBusiness[‘rates_zfb’];
}
if ($cashBusiness[‘refund_zfb’]) {
$businessList[$businesskey][‘refund_zfb’] = $cashBusiness[‘refund_zfb’];
}
if ($cashBusiness[‘real_zfb’]) {
$businessList[$businesskey][‘real_zfb’] = $cashBusiness[‘real_zfb’];
}
}
//print_r($businessList);exit;
$data = array(
‘pageStr’ => $show,
‘businessList’ => $businessList,
‘businessStatus’ => $businessStatus,
‘proAddressList’ => $proAddressList,
‘addressList’ => $addressList,
‘industryList’ => $industryList,
‘company_name’ => $company_name,
‘rate_setList’ => $rate_setList
);
$this->display($data);
}
protected function exportExcelBusinessWFTPersonal($where){
//模拟数据
import(“Org.Util.PHPExcel”);
/* @实例化 */
$obpe = new \PHPExcel();
/* @func 设置文档基本属性 */
$obpe_pro = $obpe->getProperties();
//设置当前sheet索引,用于后续的内容操作
//在处理指定Sheet的时候,需要显示调用
//缺省情况下,PHPExcel会自动创建第一个SHEET,其索引SheetIndex=0
//设置 当前处于活动状态的SHEET 为PHPExcel自动创建的第一个SHEET
$obpe->setactivesheetindex(0);
//设置sheet1表头
$head1 = array(‘商户全称’, ‘商户简称(签购单显示名称)’, ‘详细地址(含省、市)’, ‘商户性质(下拉菜单)’, ‘商户电话’, ‘联系人姓名’, ‘联系人手机号’, ‘联系人邮箱’, ‘营业执照编号’, ‘税务证编号’, ‘组织机构代码证编号’, ‘法人姓名’, ‘法人身份证号’, ‘支付通道(下拉菜单)’,
‘支付通道(下拉菜单)’, ‘手续费率(%)’,’一级类目(下拉菜单)’,’二级类目(下拉菜单)’,’三级类目(仅支付宝)(下拉菜单)’,’结算账号开户名’,’结算账号’,’账号类型(下拉菜单)’,’收款行全称’,’收款行行号(非中信账号需填)’);
//设置sheet1宽度
$obpe->getActiveSheet(0)->getColumnDimension(‘A’)->setWidth(10);
$obpe->getActiveSheet(0)->getColumnDimension(‘B’)->setWidth(30);
$obpe->getActiveSheet(0)->getColumnDimension(‘C’)->setWidth(30);
$obpe->getActiveSheet(0)->getColumnDimension(‘D’)->setWidth(30);
$obpe->getActiveSheet(0)->getColumnDimension(‘E’)->setWidth(30);
$obpe->getActiveSheet(0)->getColumnDimension(‘F’)->setWidth(30);
$obpe->getActiveSheet(0)->getColumnDimension(‘G’)->setWidth(30);
$obpe->getActiveSheet(0)->getColumnDimension(‘H’)->setWidth(30);
$obpe->getActiveSheet(0)->getColumnDimension(‘I’)->setWidth(30);
$obpe->getActiveSheet(0)->getColumnDimension(‘J’)->setWidth(30);
$obpe->getActiveSheet(0)->getColumnDimension(‘K’)->setWidth(30);
$obpe->getActiveSheet(0)->getColumnDimension(‘L’)->setWidth(30);
$obpe->getActiveSheet(0)->getColumnDimension(‘M’)->setWidth(30);
$obpe->getActiveSheet(0)->getColumnDimension(‘N’)->setWidth(30);
$obpe->getActiveSheet(0)->getColumnDimension(‘O’)->setWidth(30);
$obpe->getActiveSheet(0)->getColumnDimension(‘P’)->setWidth(30);
$obpe->getActiveSheet(0)->getColumnDimension(‘Q’)->setWidth(30);
$obpe->getActiveSheet(0)->getColumnDimension(‘R’)->setWidth(30);
$obpe->getActiveSheet(0)->getColumnDimension(‘S’)->setWidth(30);
$obpe->getActiveSheet(0)->getColumnDimension(‘T’)->setWidth(30);
$obpe->getActiveSheet(0)->getColumnDimension(‘U’)->setWidth(30);
$obpe->getActiveSheet(0)->getColumnDimension(‘V’)->setWidth(30);
$obpe->getActiveSheet(0)->getColumnDimension(‘W’)->setWidth(30);
$obpe->getActiveSheet(0)->getColumnDimension(‘X’)->setWidth(30);
//SHEET1内容
$businessService = \Lib\Utils::getService(‘Business’);
$businessModel = $businessService->model;
$where[‘excel_status’] = 0;
$businessList1 = $businessModel->field(‘posp_business.id as id,
posp_business.username as username,
posp_business_info.store_name as store_name,
posp_business_info.industrid as industrid,
posp_business.province_id as province,
posp_business.city_id as city,
posp_business_info.address as address,
posp_bank_card.realname as realname,
posp_business_info.phone as phone,
posp_bank_card.email as email,
posp_business_info.register_number as register_number,
posp_bank_card.numberid as numberid,
posp_bank_card.bank_id as bank_id,
posp_bank_card.subbranch_id as subbranch_id,
posp_bank_card.card_no as card_no’)
->join(‘posp_business_info ON posp_business.id = posp_business_info.business_id’)
->join(‘posp_bank_card ON posp_business.id = posp_bank_card.merchant_id’)
// ->where(array(“posp_business.status”=>1,”posp_business.rate_set_id”=>1,”posp_business.excel_status”=>0))
->where($where)
->order(‘posp_business.id desc’)
->select();
$mulit_arr1 = “”;
foreach ($businessList1 as $businessListKey1 => $businessListValue1) {
$channelModel = D(‘channelCategory’)->where(array(“merchant_id” => $businessListValue1[‘id’]))->find();
$id=$channelModel[‘id’];
if($channelModel[‘wx_public’]==1){
$businessListValue1[‘pay_type’] = “公众账号支付”;
$businessListValue1[‘passageway’] = “微信支付”;
$businessListValue1[‘category1’] = $channelModel[‘wx_category1’];
$businessListValue1[‘category2’] = $channelModel[‘wx_category2’];
$businessListValue1[‘category3’] = $channelModel[‘wx_category3’];
$businessListKey1 = $businessListKey1 + 1;
$mulit_arr1[$id][$businessListKey1][0] = $businessListValue1[‘store_name’];//商户全称
$mulit_arr1[$id][$businessListKey1][1] = $businessListValue1[‘store_name’];//’商户简称(签购单显示名称)’
$province_name = D(‘Addresscode’)->where(array(“province_code” => $businessListValue1[‘province’]))->find();
$city_name = D(‘Addresscode’)->where(array(“province_code” => $businessListValue1[‘city’]))->find();
$mulit_arr1[$id][$businessListKey1][2] =$province_name[‘name’].$city_name[‘name’].$businessListValue1[‘address’];;//详细地址(含省、市)
$mulit_arr1[$id][$businessListKey1][3] = “个体工商户”;//’商户性质(下拉菜单)’, ################
$mulit_arr1[$id][$businessListKey1][4] = “”.$businessListValue1[‘phone’].” “;//商户电话
$mulit_arr1[$id][$businessListKey1][5] = $businessListValue1[‘realname’];//联系人姓名
$mulit_arr1[$id][$businessListKey1][6] = “”.$businessListValue1[‘phone’].” “;//联系人手机号
$mulit_arr1[$id][$businessListKey1][7] = $businessListValue1[’email’]; //联系人邮箱
$mulit_arr1[$id][$businessListKey1][8] = “”.$businessListValue1[‘register_number’].” “;//营业执照编号
$mulit_arr1[$id][$businessListKey1][9] = “”;//税务证编号
$mulit_arr1[$id][$businessListKey1][10] =””;//组织机构代码证编号
$mulit_arr1[$id][$businessListKey1][11] =$businessListValue1[‘realname’];//法人姓名
$mulit_arr1[$id][$businessListKey1][12] = “”.$businessListValue1[‘numberid’].” “;//法人身份证号
$mulit_arr1[$id][$businessListKey1][13] = $businessListValue1[‘passageway’];//支付通道(下拉菜单)’, ################
$mulit_arr1[$id][$businessListKey1][14] = $businessListValue1[‘pay_type’];//支付方式(下拉菜单)’, ################
$mulit_arr1[$id][$businessListKey1][15] = “3.8”; //手续费率(%)
$mulit_arr1[$id][$businessListKey1][16] = $businessListValue1[‘category1’];//一级类目(下拉菜单) ################
$mulit_arr1[$id][$businessListKey1][17] = $businessListValue1[‘category2’]; //二级类目(下拉菜单) ################
$mulit_arr1[$id][$businessListKey1][18] = $businessListValue1[‘category3’]; //三级类目(仅支付宝)(下拉菜单) ################
$mulit_arr1[$id][$businessListKey1][19] = $businessListValue1[‘realname’]; //结算账号开户名’
$mulit_arr1[$id][$businessListKey1][20] = “”.$businessListValue1[‘card_no’].” “; //结算账号
$subbranch = D(‘BankInfo’)->field(‘bank_no,bank_name’)->where(array(“id” => $businessListValue1[‘bank_id’]))->find();
$mulit_arr1[$id][$businessListKey1][21] = ‘个人账号’; //账号类型(下拉菜单) ################
$mulit_arr1[$id][$businessListKey1][22] = $subbranch[‘bank_name’]; //收款行全称
$mulit_arr1[$id][$businessListKey1][23] = “”.$subbranch[‘bank_no’].” “; //收款行行号(非中信账号需填)
}
if($channelModel[‘wx_cover’]==1){
$businessListValue1[‘pay_type’] = “被扫支付”;
$businessListValue1[‘passageway’] = “微信支付”;
$businessListValue1[‘category1’] = $channelModel[‘wx_category1’];
$businessListValue1[‘category2’] = $channelModel[‘wx_category2’];
$businessListValue1[‘category3’] = $channelModel[‘wx_category3’];
$businessListKey1 = $businessListKey1 + 1;
$mulit_arr1[$id][$businessListKey1][0]= $businessListValue1[‘store_name’];//商户全称
$mulit_arr1[$id][$businessListKey1][1] = $businessListValue1[‘store_name’];//’商户简称(签购单显示名称)’
$province_name = D(‘Addresscode’)->where(array(“province_code” => $businessListValue1[‘province’]))->find();
$city_name = D(‘Addresscode’)->where(array(“province_code” => $businessListValue1[‘city’]))->find();
$mulit_arr1[$id][$businessListKey1][2] =$province_name[‘name’].$city_name[‘name’].$businessListValue1[‘address’];;//详细地址(含省、市)
$mulit_arr1[$id][$businessListKey1][3] = “个体工商户”;//’商户性质(下拉菜单)’, ################
$mulit_arr1[$id][$businessListKey1][4]= “”.$businessListValue1[‘phone’].” “;//商户电话
$mulit_arr1[$id][$businessListKey1][5] = $businessListValue1[‘realname’];//联系人姓名
$mulit_arr1[$id][$businessListKey1][6] = “”.$businessListValue1[‘phone’].” “;//联系人手机号
$mulit_arr1[$id][$businessListKey1][7] = $businessListValue1[’email’]; //联系人邮箱
$mulit_arr1[$id][$businessListKey1][8] = “”.$businessListValue1[‘register_number’].” “;//营业执照编号
$mulit_arr1[$id][$businessListKey1][9] = “”;//税务证编号
$mulit_arr1[$id][$businessListKey1][10] =””;//组织机构代码证编号
$mulit_arr1[$id][$businessListKey1][11] =$businessListValue1[‘realname’];//法人姓名
$mulit_arr1[$id][$businessListKey1][12] = “”.$businessListValue1[‘numberid’].” “;//法人身份证号
$mulit_arr1[$id][$businessListKey1][13] = $businessListValue1[‘passageway’];//支付通道(下拉菜单)’, ################
$mulit_arr1[$id][$businessListKey1][14] = $businessListValue1[‘pay_type’];//支付方式(下拉菜单)’, ################
$mulit_arr1[$id][$businessListKey1][15] = “3.8”; //手续费率(%)
$mulit_arr1[$id][$businessListKey1][16] = $businessListValue1[‘category1’];//一级类目(下拉菜单) ################
$mulit_arr1[$id][$businessListKey1][17] = $businessListValue1[‘category2’]; //二级类目(下拉菜单) ################
$mulit_arr1[$id][$businessListKey1][18] = $businessListValue1[‘category3’]; //三级类目(仅支付宝)(下拉菜单) ################
$mulit_arr1[$id][$businessListKey1][19] = $businessListValue1[‘realname’]; //结算账号开户名’
$mulit_arr1[$id][$businessListKey1][20] = “”.$businessListValue1[‘card_no’].” “; //结算账号
$subbranch = D(‘BankInfo’)->field(‘bank_no,bank_name’)->where(array(“id” => $businessListValue1[‘bank_id’]))->find();
$mulit_arr1[$id][$businessListKey1][21] = ‘个人账号’; //账号类型(下拉菜单) ################
$mulit_arr1[$id][$businessListKey1][22] = $subbranch[‘bank_name’]; //收款行全称
$mulit_arr1[$id][$businessListKey1][23] = “”.$subbranch[‘bank_no’].” “; //收款行行号(非中信账号需填)
}
if($channelModel[‘wx_qrcode’]==1){
$businessListValue1[‘pay_type’] = “二维码支付”;
$businessListValue1[‘passageway’] = “微信支付”;
$businessListValue1[‘category1’] = $channelModel[‘wx_category1’];
$businessListValue1[‘category2’] = $channelModel[‘wx_category2’];
$businessListValue1[‘category3’] = $channelModel[‘wx_category3’];
$businessListKey1 = $businessListKey1 + 1;
$mulit_arr1[$id][$businessListKey1][0] = $businessListValue1[‘store_name’];//商户全称
$mulit_arr1[$id][$businessListKey1][1] = $businessListValue1[‘store_name’];//’商户简称(签购单显示名称)’
$province_name = D(‘Addresscode’)->where(array(“province_code” => $businessListValue1[‘province’]))->find();
$city_name = D(‘Addresscode’)->where(array(“province_code” => $businessListValue1[‘city’]))->find();
$mulit_arr1[$id][$businessListKey1][2] =$province_name[‘name’].$city_name[‘name’].$businessListValue1[‘address’];;//详细地址(含省、市)
$mulit_arr1[$id][$businessListKey1][3] = “个体工商户”;//’商户性质(下拉菜单)’, ################
$mulit_arr1[$id][$businessListKey1][4]= “”.$businessListValue1[‘phone’].” “;//商户电话
$mulit_arr1[$id][$businessListKey1][5] = $businessListValue1[‘realname’];//联系人姓名
$mulit_arr1[$id][$businessListKey1][6] = “”.$businessListValue1[‘phone’].” “;//联系人手机号
$mulit_arr1[$id][$businessListKey1][7] = $businessListValue1[’email’]; //联系人邮箱
$mulit_arr1[$id][$businessListKey1][8] = “”.$businessListValue1[‘register_number’].” “;//营业执照编号
$mulit_arr1[$id][$businessListKey1][9] = “”;//税务证编号
$mulit_arr1[$id][$businessListKey1][10] =””;//组织机构代码证编号
$mulit_arr1[$id][$businessListKey1][11] =$businessListValue1[‘realname’];//法人姓名
$mulit_arr1[$id][$businessListKey1][12] = “”.$businessListValue1[‘numberid’].” “;//法人身份证号
$mulit_arr1[$id][$businessListKey1][13] = $businessListValue1[‘passageway’];//支付通道(下拉菜单)’, ################
$mulit_arr1[$id][$businessListKey1][14] = $businessListValue1[‘pay_type’];//支付方式(下拉菜单)’, ################
$mulit_arr1[$id][$businessListKey1][15] = “3.8”; //手续费率(%)
$mulit_arr1[$id][$businessListKey1][16] = $businessListValue1[‘category1’];//一级类目(下拉菜单) ################
$mulit_arr1[$id][$businessListKey1][17] = $businessListValue1[‘category2’]; //二级类目(下拉菜单) ################
$mulit_arr1[$id][$businessListKey1][18] = $businessListValue1[‘category3’]; //三级类目(仅支付宝)(下拉菜单) ################
$mulit_arr1[$id][$businessListKey1][19] = $businessListValue1[‘realname’]; //结算账号开户名’
$mulit_arr1[$id][$businessListKey1][20] = “”.$businessListValue1[‘card_no’].” “; //结算账号
$subbranch = D(‘BankInfo’)->field(‘bank_no,bank_name’)->where(array(“id” => $businessListValue1[‘bank_id’]))->find();
$mulit_arr1[$id][$businessListKey1][21] = ‘个人账号’; //账号类型(下拉菜单) ################
$mulit_arr1[$id][$businessListKey1][22] = $subbranch[‘bank_name’]; //收款行全称
$mulit_arr1[$id][$businessListKey1][23] = “”.$subbranch[‘bank_no’].” “; //收款行行号(非中信账号需填)
}
if($channelModel[‘wx_app’]==1){
$businessListValue1[‘pay_type’] = “APP支付”;
$businessListValue1[‘passageway’] = “微信支付”;
$businessListValue1[‘category1’] = $channelModel[‘wx_category1’];
$businessListValue1[‘category2’] = $channelModel[‘wx_category2’];
$businessListValue1[‘category3’] = $channelModel[‘wx_category3’];
$businessListKey1 = $businessListKey1 + 1;
$mulit_arr1[$id][$businessListKey1][0] = $businessListValue1[‘store_name’];//商户全称
$mulit_arr1[$id][$businessListKey1][1] = $businessListValue1[‘store_name’];//’商户简称(签购单显示名称)’
$province_name = D(‘Addresscode’)->where(array(“province_code” => $businessListValue1[‘province’]))->find();
$city_name = D(‘Addresscode’)->where(array(“province_code” => $businessListValue1[‘city’]))->find();
$mulit_arr1[$id][$businessListKey1][2] =$province_name[‘name’].$city_name[‘name’].$businessListValue1[‘address’];;//详细地址(含省、市)
$mulit_arr1[$id][$businessListKey1][3] = “个体工商户”;//’商户性质(下拉菜单)’, ################
$mulit_arr1[$id][$businessListKey1][4]= “”.$businessListValue1[‘phone’].” “;//商户电话
$mulit_arr1[$id][$businessListKey1][5] = $businessListValue1[‘realname’];//联系人姓名
$mulit_arr1[$id][$businessListKey1][6] = “”.$businessListValue1[‘phone’].” “;//联系人手机号
$mulit_arr1[$id][$businessListKey1][7] = $businessListValue1[’email’]; //联系人邮箱
$mulit_arr1[$id][$businessListKey1][8] = “”.$businessListValue1[‘register_number’].” “;//营业执照编号
$mulit_arr1[$id][$businessListKey1][9] = “”;//税务证编号
$mulit_arr1[$id][$businessListKey1][10] =””;//组织机构代码证编号
$mulit_arr1[$id][$businessListKey1][11] =$businessListValue1[‘realname’];//法人姓名
$mulit_arr1[$id][$businessListKey1][12] = “”.$businessListValue1[‘numberid’].” “;//法人身份证号
$mulit_arr1[$id][$businessListKey1][13] = $businessListValue1[‘passageway’];//支付通道(下拉菜单)’, ################
$mulit_arr1[$id][$businessListKey1][14] = $businessListValue1[‘pay_type’];//支付方式(下拉菜单)’, ################
$mulit_arr1[$id][$businessListKey1][15] = “3.8”; //手续费率(%)
$mulit_arr1[$id][$businessListKey1][16] = $businessListValue1[‘category1’];//一级类目(下拉菜单) ################
$mulit_arr1[$id][$businessListKey1][17] = $businessListValue1[‘category2’]; //二级类目(下拉菜单) ################
$mulit_arr1[$id][$businessListKey1][18] = $businessListValue1[‘category3’]; //三级类目(仅支付宝)(下拉菜单) ################
$mulit_arr1[$id][$businessListKey1][19] = $businessListValue1[‘realname’]; //结算账号开户名’
$mulit_arr1[$id][$businessListKey1][20] = “”.$businessListValue1[‘card_no’].” “; //结算账号
$subbranch = D(‘BankInfo’)->field(‘bank_no,bank_name’)->where(array(“id” => $businessListValue1[‘bank_id’]))->find();
$mulit_arr1[$id][$businessListKey1][21] = ‘个人账号’; //账号类型(下拉菜单) ################
$mulit_arr1[$id][$businessListKey1][22] = $subbranch[‘bank_name’]; //收款行全称
$mulit_arr1[$id][$businessListKey1][23] = “”.$subbranch[‘bank_no’].” “; //收款行行号(非中信账号需填)
}
if($channelModel[‘wx_wap’]==1){
$businessListValue1[‘pay_type’] = “wap支付”;
$businessListValue1[‘passageway’] = “微信支付”;
$businessListValue1[‘category1’] = $channelModel[‘wx_category1’];
$businessListValue1[‘category2’] = $channelModel[‘wx_category2’];
$businessListValue1[‘category3’] = $channelModel[‘wx_category3’];
$businessListKey1 = $businessListKey1 + 1;
$mulit_arr1[$id][$businessListKey1][0] = $businessListValue1[‘store_name’];//商户全称
$mulit_arr1[$id][$businessListKey1][1] = $businessListValue1[‘store_name’];//’商户简称(签购单显示名称)’
$province_name = D(‘Addresscode’)->where(array(“province_code” => $businessListValue1[‘province’]))->find();
$city_name = D(‘Addresscode’)->where(array(“province_code” => $businessListValue1[‘city’]))->find();
$mulit_arr1[$id][$businessListKey1][2] =$province_name[‘name’].$city_name[‘name’].$businessListValue1[‘address’];;//详细地址(含省、市)
$mulit_arr1[$id][$businessListKey1][3] = “个体工商户”;//’商户性质(下拉菜单)’, ################
$mulit_arr1[$id][$businessListKey1][4]= “”.$businessListValue1[‘phone’].” “;//商户电话
$mulit_arr1[$id][$businessListKey1][5] = $businessListValue1[‘realname’];//联系人姓名
$mulit_arr1[$id][$businessListKey1][6] = “”.$businessListValue1[‘phone’].” “;//联系人手机号
$mulit_arr1[$id][$businessListKey1][7] = $businessListValue1[’email’]; //联系人邮箱
$mulit_arr1[$id][$businessListKey1][8] = “”.$businessListValue1[‘register_number’].” “;//营业执照编号
$mulit_arr1[$id][$businessListKey1][9] = “”;//税务证编号
$mulit_arr1[$id][$businessListKey1][10] =””;//组织机构代码证编号
$mulit_arr1[$id][$businessListKey1][11] =$businessListValue1[‘realname’];//法人姓名
$mulit_arr1[$id][$businessListKey1][12] = “”.$businessListValue1[‘numberid’].” “;//法人身份证号
$mulit_arr1[$id][$businessListKey1][13] = $businessListValue1[‘passageway’];//支付通道(下拉菜单)’, ################
$mulit_arr1[$id][$businessListKey1][14] = $businessListValue1[‘pay_type’];//支付方式(下拉菜单)’, ################
$mulit_arr1[$id][$businessListKey1][15] = “3.8”; //手续费率(%)
$mulit_arr1[$id][$businessListKey1][16] = $businessListValue1[‘category1’];//一级类目(下拉菜单) ################
$mulit_arr1[$id][$businessListKey1][17] = $businessListValue1[‘category2’]; //二级类目(下拉菜单) ################
$mulit_arr1[$id][$businessListKey1][18] = $businessListValue1[‘category3’]; //三级类目(仅支付宝)(下拉菜单) ################
$mulit_arr1[$id][$businessListKey1][19] = $businessListValue1[‘realname’]; //结算账号开户名’
$mulit_arr1[$id][$businessListKey1][20] = “”.$businessListValue1[‘card_no’].” “; //结算账号
$subbranch = D(‘BankInfo’)->field(‘bank_no,bank_name’)->where(array(“id” => $businessListValue1[‘bank_id’]))->find();
$mulit_arr1[$id][$businessListKey1][21] = ‘个人账号’; //账号类型(下拉菜单) ################
$mulit_arr1[$id][$businessListKey1][22] = $subbranch[‘bank_name’]; //收款行全称
$mulit_arr1[$id][$businessListKey1][23] = “”.$subbranch[‘bank_no’].” “; //收款行行号(非中信账号需填)
}
if($channelModel[‘alipay_main’]==1){
$businessListValue1[‘pay_type’] = “主扫支付”;
$businessListValue1[‘passageway’] = “支付宝当面付”;
$businessListValue1[‘category1’] = $channelModel[‘alipay_category1’];
$businessListValue1[‘category2’] = $channelModel[‘alipay_category2’];
$businessListValue1[‘category3’] = $channelModel[‘alipay_category3’];
$businessListKey1 = $businessListKey1 + 1;
$mulit_arr1[$id][$businessListKey1][0] = $businessListValue1[‘store_name’];//商户全称
$mulit_arr1[$id][$businessListKey1][1] = $businessListValue1[‘store_name’];//’商户简称(签购单显示名称)’
$province_name = D(‘Addresscode’)->where(array(“province_code” => $businessListValue1[‘province’]))->find();
$city_name = D(‘Addresscode’)->where(array(“province_code” => $businessListValue1[‘city’]))->find();
$mulit_arr1[$id][$businessListKey1][2] =$province_name[‘name’].$city_name[‘name’].$businessListValue1[‘address’];;//详细地址(含省、市)
$mulit_arr1[$id][$businessListKey1][3] = “个体工商户”;//’商户性质(下拉菜单)’, ################
$mulit_arr1[$id][$businessListKey1][4]= “”.$businessListValue1[‘phone’].” “;//商户电话
$mulit_arr1[$id][$businessListKey1][5] = $businessListValue1[‘realname’];//联系人姓名
$mulit_arr1[$id][$businessListKey1][6] = “”.$businessListValue1[‘phone’].” “;//联系人手机号
$mulit_arr1[$id][$businessListKey1][7] = $businessListValue1[’email’]; //联系人邮箱
$mulit_arr1[$id][$businessListKey1][8] = “”.$businessListValue1[‘register_number’].” “;//营业执照编号
$mulit_arr1[$id][$businessListKey1][9] = “”;//税务证编号
$mulit_arr1[$id][$businessListKey1][10] =””;//组织机构代码证编号
$mulit_arr1[$id][$businessListKey1][11] =$businessListValue1[‘realname’];//法人姓名
$mulit_arr1[$id][$businessListKey1][12] = “”.$businessListValue1[‘numberid’].” “;//法人身份证号
$mulit_arr1[$id][$businessListKey1][13] = $businessListValue1[‘passageway’];//支付通道(下拉菜单)’, ################
$mulit_arr1[$id][$businessListKey1][14] = $businessListValue1[‘pay_type’];//支付方式(下拉菜单)’, ################
$mulit_arr1[$id][$businessListKey1][15] = “3.8”; //手续费率(%)
$mulit_arr1[$id][$businessListKey1][16] = $businessListValue1[‘category1’];//一级类目(下拉菜单) ################
$mulit_arr1[$id][$businessListKey1][17] = $businessListValue1[‘category2’]; //二级类目(下拉菜单) ################
$mulit_arr1[$id][$businessListKey1][18] = $businessListValue1[‘category3’]; //三级类目(仅支付宝)(下拉菜单) ################
$mulit_arr1[$id][$businessListKey1][19] = $businessListValue1[‘realname’]; //结算账号开户名’
$mulit_arr1[$id][$businessListKey1][20] = “”.$businessListValue1[‘card_no’].” “; //结算账号
$subbranch = D(‘BankInfo’)->field(‘bank_no,bank_name’)->where(array(“id” => $businessListValue1[‘bank_id’]))->find();
$mulit_arr1[$id][$businessListKey1][21] = ‘个人账号’; //账号类型(下拉菜单) ################
$mulit_arr1[$id][$businessListKey1][22] = $subbranch[‘bank_name’]; //收款行全称
$mulit_arr1[$id][$businessListKey1][23] = “”.$subbranch[‘bank_no’].” “; //收款行行号(非中信账号需填)
}
if($channelModel[‘alipay_cover’]==1){
$businessListValue1[‘pay_type’] = “被扫支付”;
$businessListValue1[‘passageway’] = “支付宝当面付”;
$businessListValue1[‘category1’] = $channelModel[‘alipay_category1’];
$businessListValue1[‘category2’] = $channelModel[‘alipay_category2’];
$businessListValue1[‘category3’] = $channelModel[‘alipay_category3’];
$businessListKey1 = $businessListKey1 + 1;
$mulit_arr1[$id][$businessListKey1][0] = $businessListValue1[‘store_name’];//商户全称
$mulit_arr1[$id][$businessListKey1][1] = $businessListValue1[‘store_name’];//’商户简称(签购单显示名称)’
$province_name = D(‘Addresscode’)->where(array(“province_code” => $businessListValue1[‘province’]))->find();
$city_name = D(‘Addresscode’)->where(array(“province_code” => $businessListValue1[‘city’]))->find();
$mulit_arr1[$id][$businessListKey1][2] =$province_name[‘name’].$city_name[‘name’].$businessListValue1[‘address’];;//详细地址(含省、市)
$mulit_arr1[$id][$businessListKey1][3] = “个体工商户”;//’商户性质(下拉菜单)’, ################
$mulit_arr1[$id][$businessListKey1][4]= “”.$businessListValue1[‘phone’].” “;//商户电话
$mulit_arr1[$id][$businessListKey1][5] = $businessListValue1[‘realname’];//联系人姓名
$mulit_arr1[$id][$businessListKey1][6] = “”.$businessListValue1[‘phone’].” “;//联系人手机号
$mulit_arr1[$id][$businessListKey1][7] = $businessListValue1[’email’]; //联系人邮箱
$mulit_arr1[$id][$businessListKey1][8] = “”.$businessListValue1[‘register_number’].” “;//营业执照编号
$mulit_arr1[$id][$businessListKey1][9] = “”;//税务证编号
$mulit_arr1[$id][$businessListKey1][10] =””;//组织机构代码证编号
$mulit_arr1[$id][$businessListKey1][11] =$businessListValue1[‘realname’];//法人姓名
$mulit_arr1[$id][$businessListKey1][12] = “”.$businessListValue1[‘numberid’].” “;//法人身份证号
$mulit_arr1[$id][$businessListKey1][13] = $businessListValue1[‘passageway’];//支付通道(下拉菜单)’, ################
$mulit_arr1[$id][$businessListKey1][14] = $businessListValue1[‘pay_type’];//支付方式(下拉菜单)’, ################
$mulit_arr1[$id][$businessListKey1][15] = “3.8”; //手续费率(%)
$mulit_arr1[$id][$businessListKey1][16] = $businessListValue1[‘category1’];//一级类目(下拉菜单) ################
$mulit_arr1[$id][$businessListKey1][17] = $businessListValue1[‘category2’]; //二级类目(下拉菜单) ################
$mulit_arr1[$id][$businessListKey1][18] = $businessListValue1[‘category3’]; //三级类目(仅支付宝)(下拉菜单) ################
$mulit_arr1[$id][$businessListKey1][19] = $businessListValue1[‘realname’]; //结算账号开户名’
$mulit_arr1[$id][$businessListKey1][20] = “”.$businessListValue1[‘card_no’].” “; //结算账号
$subbranch = D(‘BankInfo’)->field(‘bank_no,bank_name’)->where(array(“id” => $businessListValue1[‘bank_id’]))->find();
$mulit_arr1[$id][$businessListKey1][21] = ‘个人账号’; //账号类型(下拉菜单) ################
$mulit_arr1[$id][$businessListKey1][22] = $subbranch[‘bank_name’]; //收款行全称
$mulit_arr1[$id][$businessListKey1][23] = “”.$subbranch[‘bank_no’].” “; //收款行行号(非中信账号需填)
}
}
$mulit_arr1[25][0] = $head1;
//写入多行数据
$i=2;
foreach ($mulit_arr1 as $k2 => $v2) {
// dump($v2[0]);
foreach ($v2 as $k3 => $v) {
if($k3==0){
$k=1;
}else{
$k=$i++;
}
$obpe->getactivesheet()->setcellvalue(‘A’ . $k, $v[0]);
$obpe->getactivesheet()->setcellvalue(‘B’ . $k, $v[1]);
$obpe->getactivesheet()->setcellvalue(‘C’ . $k, $v[2]);
$obpe->getactivesheet()->setcellvalue(‘D’ . $k, $v[3]);
$obpe->getactivesheet()->setcellvalue(‘E’ . $k, $v[4]);
$obpe->getactivesheet()->setcellvalue(‘F’ . $k, $v[5]);
$obpe->getactivesheet()->setcellvalue(‘G’ . $k, $v[6]);
$obpe->getactivesheet()->setcellvalue(‘H’ . $k, $v[7]);
$obpe->getactivesheet()->setcellvalue(‘I’ . $k, $v[8]);
$obpe->getactivesheet()->setcellvalue(‘J’ . $k, $v[9]);
$obpe->getactivesheet()->setcellvalue(‘K’ . $k, $v[10]);
$obpe->getactivesheet()->setcellvalue(‘L’ . $k, $v[11]);
$obpe->getactivesheet()->setcellvalue(‘M’ . $k, $v[12]);
$obpe->getactivesheet()->setcellvalue(‘N’ . $k, $v[13]);
$obpe->getactivesheet()->setcellvalue(‘O’ . $k, $v[14]);
$obpe->getactivesheet()->setcellvalue(‘P’ . $k, $v[15]);
$obpe->getactivesheet()->setcellvalue(‘Q’ . $k, $v[16]);
$obpe->getactivesheet()->setcellvalue(‘R’ . $k, $v[17]);
$obpe->getactivesheet()->setcellvalue(‘S’ . $k, $v[18]);
$obpe->getactivesheet()->setcellvalue(‘T’ . $k, $v[19]);
$obpe->getactivesheet()->setcellvalue(‘U’ . $k, $v[20]);
$obpe->getactivesheet()->setcellvalue(‘V’ . $k, $v[21]);
$obpe->getactivesheet()->setcellvalue(‘W’ . $k, $v[22]);
$obpe->getactivesheet()->setcellvalue(‘X’ . $k, $v[23]);;
}
}
/* $objValidation = $obpe->getActiveSheet()->getCell(‘D’.$k,$v[3])->getDataValidation();
$objValidation->setType(\PHPExcel_Cell_DataValidation::TYPE_LIST);
$objValidation->setErrorStyle(\PHPExcel_Cell_DataValidation::STYLE_INFORMATION);
$objValidation->setAllowBlank(true);
$objValidation->setShowInputMessage(true);
$objValidation->setShowErrorMessage(true);
$objValidation->setShowDropDown(true);
$objValidation->setErrorTitle(‘Input error’);
$objValidation->setError(‘Value is not in list.’);
$objValidation->setPromptTitle(‘Pick from list’);
$objValidation->setPrompt(‘Please pick a value from the drop-down list.’);
$objValidation->setFormula1(‘”‘ . ‘政府机构,国营企业,私营企业,外资企业,个体工商户,事业单位’ . ‘”‘);*/
$time = “杭州中信”.-date(“Ymd”);
$obpe->getActiveSheet()->setTitle(‘商户基本信息’);
$obwrite = \PHPExcel_IOFactory::createWriter($obpe, ‘Excel5’);
header(‘Pragma: public’);
header(‘Expires: 0’);
header(‘Cache-Control:must-revalidate,post-check=0,pre-check=0’);
header(‘Content-Type:application/force-download’);
header(‘Content-Type:application/vnd.ms-execl’);
header(‘Content-Type:application/octet-stream’);
header(‘Content-Type:application/download’);
header(“Content-Disposition:attachment;filename='”.$time.”.xls'”);
header(‘Content-Transfer-Encoding:binary’);
$obwrite->save(‘php://output’);
}
//导出进件商户表(威付通)
protected function exportExcelBusinessWFT($where)
{
//模拟数据
import(“Org.Util.PHPExcel”);
/* @实例化 */
$obpe = new \PHPExcel();
/* @func 设置文档基本属性 */
$obpe_pro = $obpe->getProperties();
//设置当前sheet索引,用于后续的内容操作
//在处理指定Sheet的时候,需要显示调用
//缺省情况下,PHPExcel会自动创建第一个SHEET,其索引SheetIndex=0
//设置 当前处于活动状态的SHEET 为PHPExcel自动创建的第一个SHEET
$obpe->setactivesheetindex(0);
//设置sheet1表头
$head1 = array(‘序号’, ‘渠道标识’, ‘父级商户号’, ‘商户名称’, ‘商户简称’, ‘行业类别’, ‘商户类型’, ‘省份’, ‘城市’, ‘详细地址’, ‘联系人姓名’, ‘联系人电话’, ‘联系邮箱’, ‘客服电话’, ‘身份证号码’, ‘外系统商户编号’);
//设置sheet1宽度
$obpe->getActiveSheet(0)->getColumnDimension(‘A’)->setWidth(10);
$obpe->getActiveSheet(0)->getColumnDimension(‘B’)->setWidth(30);
$obpe->getActiveSheet(0)->getColumnDimension(‘C’)->setWidth(30);
$obpe->getActiveSheet(0)->getColumnDimension(‘D’)->setWidth(30);
$obpe->getActiveSheet(0)->getColumnDimension(‘E’)->setWidth(30);
$obpe->getActiveSheet(0)->getColumnDimension(‘F’)->setWidth(30);
$obpe->getActiveSheet(0)->getColumnDimension(‘G’)->setWidth(30);
$obpe->getActiveSheet(0)->getColumnDimension(‘H’)->setWidth(30);
$obpe->getActiveSheet(0)->getColumnDimension(‘I’)->setWidth(30);
$obpe->getActiveSheet(0)->getColumnDimension(‘J’)->setWidth(30);
$obpe->getActiveSheet(0)->getColumnDimension(‘K’)->setWidth(30);
$obpe->getActiveSheet(0)->getColumnDimension(‘L’)->setWidth(30);
$obpe->getActiveSheet(0)->getColumnDimension(‘M’)->setWidth(30);
$obpe->getActiveSheet(0)->getColumnDimension(‘N’)->setWidth(30);
$obpe->getActiveSheet(0)->getColumnDimension(‘O’)->setWidth(30);
$obpe->getActiveSheet(0)->getColumnDimension(‘P’)->setWidth(30);
//SHEET1内容
$businessService = \Lib\Utils::getService(‘Business’);
$businessModel = $businessService->model;
$where[‘excel_status’] = 0;
$businessList1 = $businessModel->field(‘posp_business.id as id,
posp_business.username as username,
posp_business_info.store_name as store_name,
posp_business_info.industrid as industrid,
posp_business.province_id as province,
posp_business.city_id as city,
posp_business_info.address as address,
posp_bank_card.realname as realname,
posp_business_info.phone as phone,
posp_business_info.email as email,
posp_bank_card.numberid as numberid
‘)
->join(‘posp_business_info ON posp_business.id = posp_business_info.business_id’)
->join(‘posp_bank_card ON posp_business.id = posp_bank_card.merchant_id’)
// ->where(array(“posp_business.status”=>1,”posp_business.rate_set_id”=>1,”posp_business.excel_status”=>0))
->where($where)
->order(‘posp_business.id desc’)
->select();
$mulit_arr1 = “”;
foreach ($businessList1 as $businessListKey1 => $businessListValue1) {
$businessListKey1 = $businessListKey1 + 1;
$mulit_arr1[$businessListKey1][0] = $businessListValue1[‘id’];//序号
$mulit_arr1[$businessListKey1][1] = ‘ALL_CITI0C_HEAD_879590’;//渠道标识
$mulit_arr1[$businessListKey1][2] = ”;//父级商户号(门店时是必填,如果是普通商户,不用填写)
$mulit_arr1[$businessListKey1][3] = $businessListValue1[‘store_name’];//商户名称
$mulit_arr1[$businessListKey1][4] = $businessListValue1[‘store_name’];//商户简称
$industry = D(‘Industry’)->where(array(“id” => $businessListValue1[‘industrid’]))->find();
$mulit_arr1[$businessListKey1][5] = $industry[‘name’];//行业类别(参考数据字典表中的行业类别)
//$mulit_arr[$businessListKey1][5] = $industry[‘type_id’];//行业类别(参考数据字典表中的行业类别)
$mulit_arr1[$businessListKey1][6] = ‘普通商户’;//商户类型
$province_name = D(‘Addresscode’)->where(array(“province_code” => $businessListValue1[‘province’]))->find();
$mulit_arr1[$businessListKey1][7] = $province_name[‘name’]; //省份
$city_name = D(‘Addresscode’)->where(array(“province_code” => $businessListValue1[‘city’]))->find();
$mulit_arr1[$businessListKey1][8] = $city_name[‘name’];//城市
$mulit_arr1[$businessListKey1][9] = $businessListValue1[‘address’];//地址
$mulit_arr1[$businessListKey1][10] = $businessListValue1[‘realname’];//联系人姓名
$mulit_arr1[$businessListKey1][11] = $businessListValue1[‘phone’];//联系人电话
$subBankInfo = D(‘BankCard’)->where(array(“merchant_id” => $businessListValue1[‘id’]))->find();
$mulit_arr1[$businessListKey1][12] = $subBankInfo[’email’];//联系邮箱
$mulit_arr1[$businessListKey1][13] = $businessListValue1[‘phone’];//客服电话
$mulit_arr1[$businessListKey1][14] = “”.$businessListValue1[‘numberid’].” “;//身份证号码
$mulit_arr1[$businessListKey1][15] = “”.$businessListValue1[‘username’].” “; //外系统商户编号(非特殊指定渠道,不用填写
}
$mulit_arr1[0] = $head1;
//写入多行数据
foreach ($mulit_arr1 as $k => $v) {
$k = $k + 1;
/* @func 设置列 */
$obpe->getactivesheet()->setcellvalue(‘A’ . $k, $v[0]);
$obpe->getactivesheet()->setcellvalue(‘B’ . $k, $v[1]);
$obpe->getactivesheet()->setcellvalue(‘C’ . $k, $v[2]);
$obpe->getactivesheet()->setcellvalue(‘D’ . $k, $v[3]);
$obpe->getactivesheet()->setcellvalue(‘E’ . $k, $v[4]);
$obpe->getactivesheet()->setcellvalue(‘F’ . $k, $v[5]);
$obpe->getactivesheet()->setcellvalue(‘G’ . $k, $v[6]);
$obpe->getactivesheet()->setcellvalue(‘H’ . $k, $v[7]);
$obpe->getactivesheet()->setcellvalue(‘I’ . $k, $v[8]);
$obpe->getactivesheet()->setcellvalue(‘J’ . $k, $v[9]);
$obpe->getactivesheet()->setcellvalue(‘K’ . $k, $v[10]);
$obpe->getactivesheet()->setcellvalue(‘L’ . $k, $v[11]);
$obpe->getactivesheet()->setcellvalue(‘M’ . $k, $v[12]);
$obpe->getactivesheet()->setcellvalue(‘N’ . $k, $v[13]);
$obpe->getactivesheet()->setcellvalue(‘O’ . $k, $v[14]);
$obpe->getactivesheet()->setcellvalue(‘P’ . $k, $v[15]);
}
$obpe->getActiveSheet()->setTitle(‘商户基本信息’);
//创建一个新的工作空间(sheet)
$obpe->createSheet();
$obpe->setactivesheetindex(1);
//sheet2内容
$businessList2 = $businessModel->field(‘posp_business.id as id,
posp_business.agent_id as agent_id,
posp_business.province_id as province,
posp_business.province_id as city,
posp_bank_card.card_name as card_name,
posp_bank_card.subbranch_id as subbranch_id,
posp_bank_card.card_no as card_no,
posp_bank_card.bank_id as bank_id
‘)
->join(‘posp_business_info ON posp_business.id = posp_business_info.business_id’)
->join(‘posp_bank_card ON posp_business.id = posp_bank_card.merchant_id’)
// ->where(array(“posp_business.status”=>1,”posp_business.rate_set_id”=>1,”posp_business.excel_status”=>0))
->where($where)
->order(‘posp_business.id desc’)
->select();
$mulit_arr2 = “”;
foreach ($businessList2 as $businessListKey2 => $businessListValue2) {
$businessListKey2 = $businessListKey2 + 1;
$mulit_arr2[$businessListKey2][0] = $businessListValue2[‘id’];//序号
$mulit_arr2[$businessListKey2][1] = ‘扫码支付(中信总行)-微信’;//支付中心名称
//$mulit_arr2[$businessListKey2][2] = ‘0.38%’;//商户费率
$agent = D(‘Agent’)->where(array(“id” => $businessListValue2[‘agent_id’]))->find();
$mulit_arr2[$businessListKey2][2] = ‘3.8’; //$agent[‘agent_rate_t1’]*10; //商户费率
$province_name = D(‘Addresscode’)->where(array(“province_code” => $businessListValue2[‘province’]))->find();
$mulit_arr2[$businessListKey2][3] = $province_name[‘name’]; //省份
$city_name = D(‘Addresscode’)->where(array(“province_code” => $businessListValue2[‘city’]))->find();
$mulit_arr2[$businessListKey2][4] = $city_name[‘name’];//城市
$mulit_arr2[$businessListKey2][5] = ‘个人’;//结算账号类型
$mulit_arr2[$businessListKey2][6] = $businessListValue2[‘card_name’];//结算账号户名
$subbranch = D(‘BankInfo’)->where(array(“id” => $businessListValue2[‘bank_id’]))->find();
$mulit_arr2[$businessListKey2][7] = $subbranch[‘bank_name’];//结算账户开户行
$mulit_arr2[$businessListKey2][8] = “”.$subbranch[‘bank_no’].” ” ;//人行支行联行号
$mulit_arr2[$businessListKey2][9] = “” . $businessListValue2[‘card_no’] . ” “;//结算账号
$mulit_arr2[$businessListKey2][10] = ‘否’;//是否支持收支两条线
$mulit_arr2[$businessListKey2][11] = ‘个人’;//手续费账户类型
$mulit_arr2[$businessListKey2][12] = ”;//手续费账户名称
$mulit_arr2[$businessListKey2][13] = ”;//手续费银行名称
$mulit_arr2[$businessListKey2][14] = ”;//手续费账号
$mulit_arr2[$businessListKey2][15] = ‘微信0.2‰费率’;//费率通道
}
//设置头部
$head2 = array(‘商户序号’, ‘支付中心名称’, ‘商户费率(‰)’, ‘省份’, ‘城市’, ‘结算账号类型’, ‘结算账号户名’, ‘结算账户开户行’, ‘人行支行联行号’, ‘结算账号’, ‘是否支持收支两条线’, ‘手续费账户类型’, ‘手续费账户名称’, ‘手续费银行名称’, ‘手续费账号’, ‘费率通道’);
//设置sheet1宽度
$obpe->getActiveSheet()->getColumnDimension(‘A’)->setWidth(10);
$obpe->getActiveSheet()->getColumnDimension(‘B’)->setWidth(30);
$obpe->getActiveSheet()->getColumnDimension(‘C’)->setWidth(30);
$obpe->getActiveSheet()->getColumnDimension(‘D’)->setWidth(30);
$obpe->getActiveSheet()->getColumnDimension(‘E’)->setWidth(30);
$obpe->getActiveSheet()->getColumnDimension(‘F’)->setWidth(30);
$obpe->getActiveSheet()->getColumnDimension(‘G’)->setWidth(30);
$obpe->getActiveSheet()->getColumnDimension(‘H’)->setWidth(30);
$obpe->getActiveSheet()->getColumnDimension(‘I’)->setWidth(30);
$obpe->getActiveSheet()->getColumnDimension(‘J’)->setWidth(30);
$obpe->getActiveSheet()->getColumnDimension(‘K’)->setWidth(30);
$obpe->getActiveSheet()->getColumnDimension(‘L’)->setWidth(30);
$obpe->getActiveSheet()->getColumnDimension(‘M’)->setWidth(30);
$obpe->getActiveSheet()->getColumnDimension(‘N’)->setWidth(30);
$obpe->getActiveSheet()->getColumnDimension(‘O’)->setWidth(30);
$obpe->getActiveSheet()->getColumnDimension(‘P’)->setWidth(30);
$mulit_arr2[0] = $head2;
//写入多行数据
foreach ($mulit_arr2 as $k => $v) {
$k = $k + 1;
/* @func 设置列 */
$obpe->getactivesheet()->setcellvalue(‘A’ . $k, $v[0]);
$obpe->getactivesheet()->setcellvalue(‘B’ . $k, $v[1]);
$obpe->getactivesheet()->setcellvalue(‘C’ . $k, $v[2]);
$obpe->getactivesheet()->setcellvalue(‘D’ . $k, $v[3]);
$obpe->getactivesheet()->setcellvalue(‘E’ . $k, $v[4]);
$obpe->getactivesheet()->setcellvalue(‘F’ . $k, $v[5]);
$obpe->getactivesheet()->setcellvalue(‘G’ . $k, $v[6]);
$obpe->getactivesheet()->setcellvalue(‘H’ . $k, $v[7]);
$obpe->getactivesheet()->setcellvalue(‘I’ . $k, $v[8]);
$obpe->getactivesheet()->setcellvalue(‘J’ . $k, $v[9]);
$obpe->getactivesheet()->setcellvalue(‘K’ . $k, $v[10]);
$obpe->getactivesheet()->setcellvalue(‘L’ . $k, $v[11]);
$obpe->getactivesheet()->setcellvalue(‘M’ . $k, $v[12]);
$obpe->getactivesheet()->setcellvalue(‘N’ . $k, $v[13]);
$obpe->getactivesheet()->setcellvalue(‘O’ . $k, $v[14]);
$obpe->getactivesheet()->setcellvalue(‘P’ . $k, $v[15]);
}
$time = “广州中信”.-date(“Ymd”);
//写入内容
$obpe->getActiveSheet()->setTitle(‘支付类型信息’);
$obwrite = \PHPExcel_IOFactory::createWriter($obpe, ‘Excel5’);
header(‘Pragma: public’);
header(‘Expires: 0’);
header(‘Cache-Control:must-revalidate,post-check=0,pre-check=0’);
header(‘Content-Type:application/force-download’);
header(‘Content-Type:application/vnd.ms-execl’);
header(‘Content-Type:application/octet-stream’);
header(‘Content-Type:application/download’);
header(“Content-Disposition:attachment;filename='”.$time.”.xls'”);
header(‘Content-Transfer-Encoding:binary’);
$obwrite->save(‘php://output’);
}
protected function exportExcel($where, $joinOneStr, $joinTwoStr, $joinThreeStr)
{
set_time_limit(0);
@ini_set(‘memory_limit’, ‘-1’);
//$where[‘posp_business.c’] = 0;
//转化一下条件
foreach ($where as $key => $val) {
$newWhere[‘pay_trace.’ . $key] = $val;
}
$TraceModel = D(‘Trace’);
import(“Org.Util.PHPExcel”);
import(“Org.Util.PHPExcel.Writer.Excel5”);
import(“Org.Util.PHPExcel.IOFactory.php”);
$date = date(“Y_m_d”, time());
if ($where[‘dynamic_type’] == 1) {
$prefix = “wechat_”;
} else {
$prefix = “alipay_”;
}
$fileName = $prefix . “business.xls”;
$cacheMethod = \PHPExcel_CachedObjectStorageFactory:: cache_to_discISAM;
\PHPExcel_Settings::setCacheStorageMethod($cacheMethod);
//创建PHPExcel对象,注意,不能少了\
$objPHPExcel = new \PHPExcel();
$objProps = $objPHPExcel->getProperties();
$fwcShopModel = new \Common\Model\Fwc\CompanyModel(); //查询同一平台中的开店信息
//设置头部
/**
* $headArr = array(
* ‘商户编号’,
* ‘商户名称’,’所属代理商’,’代理商编号’,’店铺名称’,’口碑是否上架’,’口碑审核状态’,
* );
*/
$headArr = array(
‘商户编号’,
‘商户名称’, ‘所属代理商’, ‘代理商编号’, ‘联系电话’, ‘手机’,
);
//设置表头
$key = ord(“A”);
//print_r($headArr);exit;
foreach ($headArr as $v) {
$colum = chr($key);
$objPHPExcel->setActiveSheetIndex(0)->setCellValue($colum . ‘1’, $v);
$objPHPExcel->setActiveSheetIndex(0)->setCellValue($colum . ‘1’, $v);
$key += 1;
}
$objPHPExcel->getActiveSheet()->getColumnDimension(‘A’)->setWidth(15);
$objPHPExcel->getActiveSheet()->getColumnDimension(‘B’)->setWidth(30);
$objPHPExcel->getActiveSheet()->getColumnDimension(‘C’)->setWidth(30);
$objPHPExcel->getActiveSheet()->getColumnDimension(‘D’)->setWidth(15);
$objPHPExcel->getActiveSheet()->getColumnDimension(‘E’)->setWidth(15);
$objPHPExcel->getActiveSheet()->getColumnDimension(‘F’)->setWidth(15);
//$objPHPExcel->getActiveSheet()->getColumnDimension(‘E’)->setWidth(30);
//$objPHPExcel->getActiveSheet()->getColumnDimension(‘F’)->setWidth(15);
//$objPHPExcel->getActiveSheet()->getColumnDimension(‘G’)->setWidth(15);
$column = 2;
$objActSheet = $objPHPExcel->getActiveSheet();
$businessService = \Lib\Utils::getService(‘Business’);
$businessModel = $businessService->model;
$data = $businessModel->field(‘posp_business.serial_no as business_serial_no,posp_business_info.company_name as business_company_name,posp_agent_info.company_name as agent_company_name,posp_agent_info.serial_no as agent_serial_no,posp_business_info.phone as business_phone,posp_business_info.mobile as business_mobile’)
->join($joinOneStr, ‘left’)
->join($joinTwoStr, ‘left’)
->join($joinThreeStr, ‘left’)
->where($where)
->order(‘posp_business.id desc’)
->select();
//echo $businessModel->_sql();exit;
/**
* foreach($data as $businesskey=>$businessvalue){
* if($businessvalue[‘business_serial_no’]){
* $shopStatus = $fwcShopModel->getShopStatus($businessvalue[‘business_serial_no’]);
* $data[$businesskey][‘company_name’] = $shopStatus[0][‘company_name’];
* if($shopStatus[0][‘koubei_online’] == 1){
* $koubei_online = ‘未上架’;
* }elseif($shopStatus[0][‘koubei_online’] == 2){
* $koubei_online = ‘已上架’;
* }elseif(empty($shopStatus[0][‘company_name’])){
* $koubei_online = “”;
* }else{
* $koubei_online = ‘未提交上架申请’;
* }
* $data[$businesskey][‘koubei_online’] = $koubei_online ;
* if($shopStatus[0][‘koubei_status’] == 1){
* $koubei_status = ‘审核中’;
* }elseif($shopStatus[0][‘koubei_status’] == 2){
* $koubei_status = ‘审核通过’;
* }elseif($shopStatus[0][‘koubei_status’] == 3){
* $koubei_status = ‘审核驳回’;
* }elseif(empty($shopStatus[0][‘company_name’])){
* $koubei_status = “”;
* }else{
* $koubei_status = ‘未提交审核申请’;
* }
* $data[$businesskey][‘koubei_status’] = $koubei_status;
*
* }else{
* $data[$businesskey][‘company_name’] = “”;
* $data[$businesskey][‘koubei_online’] = “”;
* $data[$businesskey][‘koubei_status’] = “”;
* }
* }
*/
foreach ($data as $rows) { //行写入
$span = ord(“A”);
foreach ($rows as $keyName => $value) {// 列写入
$j = chr($span);
//if($j == ‘B’ )
// $objActSheet->setCellValueExplicit($j.$column, $value,\PHPExcel_Cell_DataType::TYPE_NUMERIC);
//else
$objActSheet->setCellValueExplicit($j . $column, $value, \PHPExcel_Cell_DataType::TYPE_STRING2);
/**
* if($value[‘serial_no’]){
* $shopStatus = $fwcShopModel->getShopStatus($value[‘serial_no’]);
* $objActSheet->setCellValueExplicit(‘E’.$column, $shopStatus[0][‘company_name’],\PHPExcel_Cell_DataType::TYPE_STRING2);
* $objActSheet->setCellValueExplicit(‘F’.$column, $shopStatus[0][‘koubei_online’],\PHPExcel_Cell_DataType::TYPE_STRING2);
* $objActSheet->setCellValueExplicit(‘G’.$column, $shopStatus[0][‘koubei_status’],\PHPExcel_Cell_DataType::TYPE_STRING2);
*
* }
*/
$span++;
}
$column++;
}
/**
* 新版本不需要分页
* //分页写入
* for($i=1;$i<=$total_page;$i++){
* //取数据
* $data = $TraceModel->field(‘pay_trace.trace_id,pay_trace.trace_num,pay_trace.merchant_name,pay_trace.trans_subject,pay_trace.trans_time,pay_trace.trans_status,pay_trace.total_fee,pay_trace.refund_fee,posp_business.serial_no,concat(posp_agent_info.company_name,”(“,posp_agent_info.serial_no,”)”) as agentinfo ‘)
* ->join(‘posp_business ON posp_business.id = pay_trace.business_id’,’left’)
* ->join(‘posp_agent_info ON posp_agent_info.agent_id = posp_business.agent_id’,’left’)
* ->where($where)
* ->page($i,1000)
* ->select();
*
* foreach($data as $rows){ //行写入
* $span = ord(“A”);
* foreach($rows as $keyName=>$value){// 列写入
* $j = chr($span);
* if($keyName == ‘trans_status’)
* $value = $TraceModel->traceStatus2[$value];
* $objActSheet->setCellValueExplicit($j.$column, $value,\PHPExcel_Cell_DataType::TYPE_STRING);
* $span++;
* }
* $column++;
* }
* }
*/
$fileName = iconv(“utf-8”, “gb2312”, $fileName);
//重命名表
//$objPHPExcel->getActiveSheet()->setTitle(‘test’);
//设置活动单指数到第一个表,所以Excel打开这是第一个表
$objPHPExcel->setActiveSheetIndex(0);
header(‘Content-Type: application/vnd.ms-excel’);
header(“Content-Disposition: attachment;filename=\”$fileName\””);
header(‘Cache-Control: max-age=0’);
$objWriter = \PHPExcel_IOFactory::createWriter($objPHPExcel, ‘Excel5’);
$objWriter->save(‘php://output’); //文件通过浏览器下载
exit;
}
/**
* protected function exportExcel($where,$joinOneStr,$joinTwoStr,$joinThreeStr){
* set_time_limit(0);
* @ini_set(‘memory_limit’, ‘-1’);
*
*
* //转化一下条件
* foreach($where as $key=>$val){
* $newWhere[‘pay_trace.’.$key] = $val;
* }
*
* $TraceModel = D(‘Trace’);
*
* import(“Org.Util.PHPExcel”);
* import(“Org.Util.PHPExcel.Writer.Excel5”);
* import(“Org.Util.PHPExcel.IOFactory.php”);
*
* $date = date(“Y_m_d”,time());
* if($where[‘dynamic_type’] == 1)
* {
* $prefix = “wechat_”;
* }
* else
* {
* $prefix = “alipay_”;
* }
* $fileName = $prefix.”business.xls”;
*
*
* $cacheMethod = \PHPExcel_CachedObjectStorageFactory:: cache_to_discISAM;
* \PHPExcel_Settings::setCacheStorageMethod($cacheMethod);
*
* //创建PHPExcel对象,注意,不能少了\
* $objPHPExcel = new \PHPExcel();
* $objProps = $objPHPExcel->getProperties();
*
*
* //设置头部
* $headArr = array(
* ‘商户编号’,
* ‘商户名称’,’所属代理商’,’代理商编号’,’联系人’,’手机1′,’手机2′,
* );
*
* //设置表头
* $key = ord(“A”);
* //print_r($headArr);exit;
* foreach($headArr as $v){
* $colum = chr($key);
* $objPHPExcel->setActiveSheetIndex(0) ->setCellValue($colum.’1′, $v);
* $objPHPExcel->setActiveSheetIndex(0) ->setCellValue($colum.’1′, $v);
* $key += 1;
* }
*
* $objPHPExcel->getActiveSheet()->getColumnDimension(‘A’)->setWidth(15);
* $objPHPExcel->getActiveSheet()->getColumnDimension(‘B’)->setWidth(30);
* $objPHPExcel->getActiveSheet()->getColumnDimension(‘C’)->setWidth(30);
* $objPHPExcel->getActiveSheet()->getColumnDimension(‘D’)->setWidth(15);
* $objPHPExcel->getActiveSheet()->getColumnDimension(‘E’)->setWidth(30);
* $objPHPExcel->getActiveSheet()->getColumnDimension(‘F’)->setWidth(15);
* $objPHPExcel->getActiveSheet()->getColumnDimension(‘G’)->setWidth(15);
* //$objPHPExcel->getActiveSheet()->getColumnDimension(‘H’)->setWidth(45);
*
* $column = 2;
* $objActSheet = $objPHPExcel->getActiveSheet();
* $businessService = \Lib\Utils::getService(‘Business’);
* $businessModel = $businessService->model;
* $data = $businessModel->field(‘posp_business.serial_no as business_serial_no,posp_business_info.company_name as business_company_name,posp_agent_info.company_name as agent_company_name,posp_agent_info.serial_no as agent_serial_no,posp_business_info.contacts as business_contacts,posp_business_info.phone as business_phone,posp_business_info.mobile as business_mobile’)
* ->join($joinOneStr,’left’)
* ->join($joinTwoStr,’left’)
* ->join($joinThreeStr,’left’)
* ->where($where)
* ->order(‘posp_business.id desc’)
* ->select();
* //echo $businessModel->_sql();exit;
* //print_r($data);
* //exit;
*
* foreach($data as $rows){ //行写入
* $span = ord(“A”);
* foreach($rows as $keyName=>$value){// 列写入
* $j = chr($span);
* //if($j == ‘B’ )
* // $objActSheet->setCellValueExplicit($j.$column, $value,\PHPExcel_Cell_DataType::TYPE_NUMERIC);
* //else
* $objActSheet->setCellValueExplicit($j.$column, $value,\PHPExcel_Cell_DataType::TYPE_STRING2);
* $span++;
* }
* $column++;
* }
*
*
*
* $fileName = iconv(“utf-8”, “gb2312”, $fileName);
* //重命名表
* //$objPHPExcel->getActiveSheet()->setTitle(‘test’);
* //设置活动单指数到第一个表,所以Excel打开这是第一个表
* $objPHPExcel->setActiveSheetIndex(0);
* header(‘Content-Type: application/vnd.ms-excel’);
* header(“Content-Disposition: attachment;filename=\”$fileName\””);
* header(‘Cache-Control: max-age=0’);
*
* $objWriter = \PHPExcel_IOFactory::createWriter($objPHPExcel, ‘Excel5’);
* $objWriter->save(‘php://output’); //文件通过浏览器下载
* exit;
*
* }
*/
public function editBusiness()
{
$id = I(‘id’);
$businessService = \Lib\Utils::getService(‘Business’);
$businessInfo = $businessService->model->find($id);
//print_r($businessInfo);exit;
$businessInfoService = \Lib\Utils::getService(‘BusinessInfo’);
$where = array(
‘business_id’ => $id
);
$businessExtInfo = $businessInfoService->model->where($where)->find();
if (IS_POST) {
$data = I(‘data’);
$addressArr = I(‘address’);
if (count($addressArr) < 2) {
//$this->errorPage(‘地址信息必须填写完整’);
}
//查看营业执照注册号是否有重复
$info = I(‘info’);
if ($info[‘register_number’]) {
$hasResult = $businessInfoService->getBusinessByRegNum($info[‘register_number’], $id);
$message = ”;
if ($hasResult) {
$info[‘register_number’] = ”;
$message = ‘营业执照注册号错误!请核对后再次修改’;
}
}
if ($message) {
$this->errorPage($message);
}
$saveData = array(
‘status’ => $data[‘status’],
‘verify_reason’ => $data[‘verify_reason’],
‘bank_merchantid’ => $data[‘bank_merchantid’],
‘rate_set_id’ => $data[‘rate_set_id’],
‘province_id’ => $addressArr[0],
‘city_id’ => $addressArr[1],
‘town_id’ => $addressArr[2] ? $addressArr[2] : 0,
‘expire_time’ => strtotime($data[‘expire_time’]) + 86399,
‘id’ => $id
);
$businessService->model->save($saveData);
//print_r($info);exit;
$businessInfoService->model->where(array(‘business_id’ => $id))->save($info);
//同步商户到服务窗
$b_info = $businessService->model->where(array(“id” => $id))->find();
$b_ext_info = $businessInfoService->model->where(array(‘business_id’ => $id))->find();
$rsyncInfo = array_merge($b_info, $b_ext_info);
$fwcMerchantModel = new \Common\Model\Fwc\MerchantModel();
$fwcMerchantModel->rsyncFwcMerchant($rsyncInfo);
//print_r($rsyncInfo);exit;
$this->successPage(‘信息修改成功’);
exit;
} else {
$addressModel = D(‘Address’);
$proAddressList = $cityAddressList = $townAddressList = array();
$proAddressList = $addressModel->getChildAddressByIdCache(0);
if ($businessInfo[‘province_id’]) {
$cityAddressList = $addressModel->getChildAddressByIdCache($businessInfo[‘province_id’]);
}
if ($businessInfo[‘city_id’]) {
$townAddressList = $addressModel->getChildAddressByIdCache($businessInfo[‘city_id’]);
}
$businessStatus = $businessService->businessStatus;
//银行卡信息
$cardInfo = D(‘Bank_card’)->where(array(“merchant_id” => $id))->find();
//地址
$province_name = D(‘Address’)->where(array(“id” => $cardInfo[‘province’]))->find();
$cardInfo[‘province_name’] = $province_name[‘name’];
$city_name = D(‘Address’)->where(array(“id” => $cardInfo[‘city’]))->find();
$cardInfo[‘city_name’] = $city_name[‘name’];
//开户银行
$bankInfo = D(‘Bank’)->where(array(“id” => $cardInfo[‘bank_id’]))->find();
$cardInfo[‘bank_name’] = $bankInfo[‘name’];
//开户支行
$subBankInfo = D(‘BankSub’)->where(array(“id” => $cardInfo[‘subbranch_id’]))->find();
$cardInfo[‘subbank_name’] = $subBankInfo[‘bank_sub_name’];
$industryInfo = D(‘Industry’)->where(array(“id” => $businessExtInfo[‘industrid’]))->find();
$cardInfo[‘industry_name’] = $industryInfo[‘name’];
//渠道
$ratSetInfo = D(‘RateSet’)->where(array(“state” => 0))->select();
$data = array(
‘businessInfo’ => $businessInfo,
‘businessExtInfo’ => $businessExtInfo,
‘proAddressList’ => $proAddressList,
‘cityAddressList’ => $cityAddressList,
‘townAddressList’ => $townAddressList,
‘businessStatus’ => $businessStatus,
‘cardInfo’ => $cardInfo,
‘ratSetInfo’ => $ratSetInfo
);
$this->display($data);
}
}
public function editStatus()
{
$businessStatus = I(‘businessStatus’);
$allBusinessId = I(‘businessId’);
if ($allBusinessId) {
$businessService = \Lib\Utils::getService(‘Business’);
$where = array();
$where[‘id’] = array(‘in’, $allBusinessId);
$saveData = array(
‘status’ => $businessStatus
);
$businessService->model->where($where)->save($saveData);
//同步商户到服务窗
$businessService = \Lib\Utils::getService(‘Business’);
$businessInfoService = \Lib\Utils::getService(‘BusinessInfo’);
$allBusinessId = explode(“,”, $allBusinessId);
foreach ($allBusinessId as $key => $id) {
$b_info = $businessService->model->where(array(“id” => $id))->find();
$b_ext_info = $businessInfoService->model->where(array(‘business_id’ => $id))->find();
$rsyncInfo = array_merge($b_info, $b_ext_info);
$fwcUsersModel = new \Common\Model\Fwc\UsersModel();
$fwcUsersModel->rsyncFwcMerchant($rsyncInfo);
}
$resultData = array(‘code’ => 200, ‘message’ => ‘已修改’);
$this->ajaxReturn($resultData);
} else {
$resultData = array(‘code’ => 201, ‘message’ => ‘未选择有效的商户’);
$this->ajaxReturn($resultData);
}
}
//重置密码
public function resetPwd()
{
$serial_no = $_GET[‘serial_no’];
if (!$serial_no) $this->errorPage(“商户编号为空”);
$pwd = md5(“123456”);
$businessService = \Lib\Utils::getService(‘Business’);
$where = array(
array(‘serial_no’ => $serial_no)
);
$agentUser = $businessService->model->where($where)->find();
if ($agentUser && $agentUser[‘status’] == 1) {
$saveData = array(
‘password’ => $pwd
);
$businessService->model->where($where)->save($saveData);
$fwcUsersModel = new \Common\Model\Fwc\UsersModel();
$fwcUsersModel->resetPassword($serial_no, $pwd);
$this->successPage(“重置成功”);
} else {
$this->errorPage(“商户不存在或者商户状态不正确”);
}
}
//重置账号
public function resetAccount()
{
$serial_no = $_GET[‘serial_no’];
if (!$serial_no) $this->errorPage(“商户编号为空”);
$businessService = \Lib\Utils::getService(‘Business’);
$where = array(
array(‘serial_no’ => $serial_no)
);
$agentUser = $businessService->model->where($where)->find();
if ($agentUser && $agentUser[‘status’] == 1) {
$fwcUsersModel = new \Common\Model\Fwc\UsersModel();
$fwcUsersModel->resetAccount($serial_no);
$this->successPage(“账号同步成功”);
} else {
$this->errorPage(“商户不存在或者商户状态不正确”);
}
}
//商户转移
public function businessTransfer()
{
if (IS_POST) {
$data = I(‘data’);
//商户编号
if (empty($data[‘business’])) {
$this->errorPage(“商户编号必须填写!”);
}
//代理商编号
if (empty($data[‘agent’])) {
$this->errorPage(“代理商编号必须填写!”);
}
//判断商户编号是否存在
$businessService = \Lib\Utils::getService(‘Business’);
$where = array(
array(‘serial_no’ => $data[‘business’])
);
$businessUser = $businessService->model->where($where)->find();
if (empty($businessUser)) {
$this->errorPage(“商户编号不存在!”);
}
//判断代理商编号是否存在
$agentService = \Lib\Utils::getService(‘Agent’);
$where = array(
array(‘serial_no’ => $data[‘agent’])
);
$agentUser = $agentService->model->where($where)->find();
if (empty($agentUser)) {
$this->errorPage(“代理商编号不存在!”);
}
//商户转移
$agentUserId = $agentUser[‘id’];//代理商ID
if ($agentUserId) {
$transfer_where = array(
array(‘serial_no’ => $data[‘business’])
);
$transfer_data = array(
‘agent_id’ => $agentUserId
);
$update_status = $businessService->model->where($transfer_where)->save($transfer_data);
if ($update_status !== false) {
$this->successPage(“商户转移成功!”);
} else {
$this->errorPage(“商户转移失败!”);
}
}
}
$this->display();
}
public function shop()
{
ini_set(“memory_limit”, “-1”);
$businessService = \Lib\Utils::getService(‘Business’);
$businessModel = $businessService->model;
$fwcShopModel = new \Common\Model\Fwc\CompanyModel(); //查询同一平台中的开店信息
$where = “”;
if (I(‘serial_no’)) {
if ($where) {
$where .= ” and unify_platform.pigcms_users.serial_no = ” . I(‘serial_no’);
} else {
$where = ” unify_platform.pigcms_users.serial_no = ” . I(‘serial_no’);
}
}
if (I(‘name’)) {
if ($where) {
$where .= ” and unify_platform.pigcms_company.name like ‘%” . urldecode(I(‘name’)) . “%’ “;
} else {
$where = ” unify_platform.pigcms_company.name like ‘%” . urldecode(I(‘name’)) . “%’ “;
}
}
if (((I(‘koubei_online’) == 0) || (I(‘koubei_online’) == 1) || (I(‘koubei_online’) == 2)) && (I(‘koubei_online’) != ”)) {
if ($where) {
$where .= ” and unify_platform.pigcms_company.koubei_online = ” . I(‘koubei_online’);
} else {
$where = ” unify_platform.pigcms_company.koubei_online = ” . I(‘koubei_online’);
}
}
if (((I(‘koubei_status’) == 0) || (I(‘koubei_status’) == 1) || (I(‘koubei_status’) == 2) || (I(‘koubei_status’) == 3)) && (I(‘koubei_status’) != ”)) {
if ($where) {
$where .= ” and unify_platform.pigcms_company.koubei_status = ” . I(‘koubei_status’);
} else {
$where = ” unify_platform.pigcms_company.koubei_status = ” . I(‘koubei_status’);
}
}
if ((I(‘koubei_online’) == ”) && (I(‘koubei_status’) == ”)) {
/**
* if($where){
* $where .= ” and unify_platform.pigcms_company.koubei_online is not null and unify_platform.pigcms_company.koubei_status is not null “;
* }else{
* $where = ” unify_platform.pigcms_company.koubei_online is not null and unify_platform.pigcms_company.koubei_status is not null “;
* }
*/
if ($where) {
$where .= ” and unify_platform.pigcms_users.id is not null “;
} else {
$where = ” unify_platform.pigcms_users.id is not null “;
}
}
$fwcShopCount = $fwcShopModel->getShopCount($where);
$Page = new \Think\PageBoot(count($fwcShopCount), 10); // 实例化分页类 传入总记录数和每页显示的记录数(25)
$show = $Page->show();
//echo $fwcShopModel->_sql();exit;
$fwcShopList = $fwcShopModel->getShop($where, $Page->firstRow, $Page->listRows);
foreach ($fwcShopList as $key => $value) {
if ($value[‘serial_no’]) { //查询POSP中的所属代理商
$agentInfo = “”;
$agentInfoWhere[‘posp_business.serial_no’] = $value[‘serial_no’];
$agentInfo = $businessModel->field(‘posp_agent_info.company_name as agent_company_name,posp_agent_info.serial_no as agent_serial_no’)->join(‘posp_agent_info ON posp_business.agent_id = posp_agent_info.agent_id’, ‘left’)->where($agentInfoWhere)->find();
$fwcShopList[$key][‘agent_company_name’] = $agentInfo[‘agent_company_name’];
$fwcShopList[$key][‘agent_serial_no’] = $agentInfo[‘agent_serial_no’];
}
$fwcShopList[$key][‘shop_type’] = “未选择门店类目”;
if ($value[‘fu_category_id’] || $value[‘mid_category_id’]) {
$fwcShopList[$key][‘shop_type’] = $this->shopType($value[‘fu_category_id’], $value[‘mid_category_id’], $value[‘category_id’]);
}
}
$data = array(
‘pageStr’ => $show,
‘shopList’ => $fwcShopList
);
$this->display($data);
}
public function shopAlipay()
{
ini_set(“memory_limit”, “-1”);
$businessService = \Lib\Utils::getService(‘Business’);
$businessModel = $businessService->model;
$fwcShopModel = new \Common\Model\Fwc\CompanyModel(); //查询同一平台中的开店信息
$where = “”;
if (!I(‘serial_no’)) {
$this->errorPage(‘非法操作!’);
}
if (I(‘serial_no’)) {
if ($where) {
$where .= ” and unify_platform.pigcms_users.serial_no = ” . I(‘serial_no’);
} else {
$where = ” unify_platform.pigcms_users.serial_no = ” . I(‘serial_no’);
}
}
if (I(‘shop_name’)) {
if ($where) {
$where .= ” and unify_platform.pigcms_wxuser.wxname like ‘%” . urldecode(I(‘shop_name’)) . “%’ “;
} else {
$where = ” unify_platform.pigcms_wxuser.wxname like ‘%” . urldecode(I(‘shop_name’)) . “%’ “;
}
}
if (I(‘store_number’)) {
$store_number = trim(I(‘store_number’));
$store_number = substr($store_number, 10, 15);
if ($where) {
$where .= ” and unify_platform.pigcms_wxuser.id = ” . $store_number;
} else {
$where = ” unify_platform.pigcms_wxuser.id = ” . $store_number;
}
}
if (((I(‘koubei_online’) == 0) || (I(‘koubei_online’) == 1) || (I(‘koubei_online’) == 2)) && (I(‘koubei_online’) != ”)) {
if ($where) {
$where .= ” and unify_platform.pigcms_company.koubei_online = ” . I(‘koubei_online’);
} else {
$where = ” unify_platform.pigcms_company.koubei_online = ” . I(‘koubei_online’);
}
}
if (((I(‘koubei_status’) == 0) || (I(‘koubei_status’) == 1) || (I(‘koubei_status’) == 2) || (I(‘koubei_status’) == 3)) && (I(‘koubei_status’) != ”)) {
if ($where) {
$where .= ” and unify_platform.pigcms_company.koubei_status = ” . I(‘koubei_status’);
} else {
$where = ” unify_platform.pigcms_company.koubei_status = ” . I(‘koubei_status’);
}
}
if ((I(‘koubei_online’) == ”) && (I(‘koubei_status’) == ”)) {
/**
* if($where){
* $where .= ” and unify_platform.pigcms_company.koubei_online is not null and unify_platform.pigcms_company.koubei_status is not null “;
* }else{
* $where = ” unify_platform.pigcms_company.koubei_online is not null and unify_platform.pigcms_company.koubei_status is not null “;
* }
*/
}
if ($where) {
$where .= ” and unify_platform.pigcms_wxuser.statues = 1 “;
} else {
$where = ” unify_platform.pigcms_wxuser.statues = 1 “;
}
$fwcShopCount = $fwcShopModel->getShopCount($where);
$Page = new \Think\PageBoot(count($fwcShopCount), 10); // 实例化分页类 传入总记录数和每页显示的记录数(25)
$show = $Page->show();
//echo $fwcShopModel->_sql();exit;
$fwcShopList = $fwcShopModel->getShop($where, $Page->firstRow, $Page->listRows);
$TraceModel = D(‘TraceSelect’);
foreach ($fwcShopList as $key => $value) {
if ($value[‘serial_no’]) { //查询POSP中的所属代理商
$agentInfo = “”;
$agentInfoWhere[‘posp_business.serial_no’] = $value[‘serial_no’];
$agentInfo = $businessModel->field(‘posp_agent_info.company_name as agent_company_name,posp_agent_info.serial_no as agent_serial_no’)->join(‘posp_agent_info ON posp_business.agent_id = posp_agent_info.agent_id’, ‘left’)->where($agentInfoWhere)->find();
$fwcShopList[$key][‘agent_company_name’] = $agentInfo[‘agent_company_name’];
$fwcShopList[$key][‘agent_serial_no’] = $agentInfo[‘agent_serial_no’];
}
$fwcShopList[$key][‘shop_type’] = “未选择门店类目”;
if ($value[‘fu_category_id’] || $value[‘mid_category_id’]) {
$fwcShopList[$key][‘shop_type’] = $this->shopType($value[‘fu_category_id’], $value[‘mid_category_id’], $value[‘category_id’]);
}
$store_number = ”;
$store_number = $this->create_storenumber($value[‘wxuser_id’]);
$fwcShopList[$key][‘store_number’] = $store_number;
//商户昨日支付宝交易额(交易成功)
//S(date(“Y-m-d”).”yesterday_alipay_”.$store_number,null) ;
if (!S(date(“Y-m-d”) . “yesterday_alipay_” . $store_number)) {
$yesterdayAlipayWhere[‘merchant_num’] = $store_number;
$yesterdayAlipayWhere[‘trans_status’] = 1;
$yesterdayAlipayWhere[‘dynamic_type’] = array(‘in’, ‘0,2,4’);
$yesterdayAlipayWhere[‘trans_begin’] = array(array(‘egt’, date(“Y-m-d 00:00:00”, strtotime(“-1 days”))), array(‘elt’, date(“Y-m-d 23:59:59”, strtotime(“-1 days”))), ‘and’);
$yesterdayAlipayTrace = $TraceModel->field(“IFNULL(SUM(total_fee),0.00) as total_fee,IFNULL(COUNT(*),0) as total_count”)->where($yesterdayAlipayWhere)->select();
S(date(“Y-m-d”) . “yesterday_alipay_” . $store_number, $yesterdayAlipayTrace[0], 86400);
}
$yesterday_alipay = S(date(“Y-m-d”) . “yesterday_alipay_” . $store_number);
$fwcShopList[$key][‘yesterday_alipay’] = $yesterday_alipay[‘total_fee’];
$fwcShopList[$key][‘yesterday_alipay_count’] = $yesterday_alipay[‘total_count’];
//商户昨日支付宝退款撤销交易额
//S(date(“Y-m-d”).”yesterday_alipay_del_”.$store_number,null) ;
if (!S(date(“Y-m-d”) . “yesterday_alipay_del_” . $store_number)) {
$yesterdayAlipayDelWhere[‘merchant_num’] = $store_number;
$yesterdayAlipayDelWhere[‘trans_status’] = array(‘in’, ‘2,3’);
$yesterdayAlipayDelWhere[‘dynamic_type’] = array(‘in’, ‘0,2,4’);
$yesterdayAlipayDelWhere[‘trans_begin’] = array(array(‘egt’, date(“Y-m-d 00:00:00”, strtotime(“-1 days”))), array(‘elt’, date(“Y-m-d 23:59:59”, strtotime(“-1 days”))), ‘and’);
$yesterdayAlipayDelTrace = $TraceModel->field(“IFNULL(SUM(total_fee),0.00) as total_fee,IFNULL(COUNT(*),0) as total_count”)->where($yesterdayAlipayDelWhere)->select();
S(date(“Y-m-d”) . “yesterday_alipay_del_” . $store_number, $yesterdayAlipayDelTrace[0], 86400);
}
$yesterday_alipay_del = S(date(“Y-m-d”) . “yesterday_alipay_del_” . $store_number);
$fwcShopList[$key][‘yesterday_alipay_del’] = $yesterday_alipay_del[‘total_fee’];
$fwcShopList[$key][‘yesterday_alipay_del_count’] = $yesterday_alipay_del[‘total_count’];
//商户昨日支付宝总交易额
$fwcShopList[$key][‘yesterday_alipay_total’] = $yesterday_alipay[‘total_fee’] + $yesterday_alipay_del[‘total_fee’];
$fwcShopList[$key][‘yesterday_alipay_total_count’] = $yesterday_alipay[‘total_count’] + $yesterday_alipay_del[‘total_count’];
}
$data = array(
‘pageStr’ => $show,
‘shopList’ => $fwcShopList
);
$this->display($data);
}
public function shopWeixin()
{
ini_set(“memory_limit”, “-1”);
$businessService = \Lib\Utils::getService(‘Business’);
$businessModel = $businessService->model;
$fwcShopModel = new \Common\Model\Fwc\CompanyModel(); //查询同一平台中的开店信息
$where = “”;
if (!I(‘serial_no’)) {
$this->errorPage(‘非法操作!’);
}
if (I(‘serial_no’)) {
if ($where) {
$where .= ” and unify_platform.pigcms_users.serial_no = ” . I(‘serial_no’);
} else {
$where = ” unify_platform.pigcms_users.serial_no = ” . I(‘serial_no’);
}
}
if (I(‘shop_name’)) {
if ($where) {
$where .= ” and unify_platform.pigcms_wxuser.wxname like ‘%” . urldecode(I(‘shop_name’)) . “%’ “;
} else {
$where = ” unify_platform.pigcms_wxuser.wxname like ‘%” . urldecode(I(‘shop_name’)) . “%’ “;
}
}
if (I(‘store_number’)) {
$store_number = trim(I(‘store_number’));
$store_number = substr($store_number, 10, 15);
if ($where) {
$where .= ” and unify_platform.pigcms_wxuser.id = ” . $store_number;
} else {
$where = ” unify_platform.pigcms_wxuser.id = ” . $store_number;
}
}
if ($where) {
$where .= ” and unify_platform.pigcms_wxuser.statues = 1 “;
} else {
$where = ” unify_platform.pigcms_wxuser.statues = 1 “;
}
$fwcShopCount = $fwcShopModel->getShopCount($where);
$Page = new \Think\PageBoot(count($fwcShopCount), 10); // 实例化分页类 传入总记录数和每页显示的记录数(25)
$show = $Page->show();
//echo $fwcShopModel->_sql();exit;
$fwcShopList = $fwcShopModel->getShop($where, $Page->firstRow, $Page->listRows);
$TraceModel = D(‘TraceSelect’);
foreach ($fwcShopList as $key => $value) {
if ($value[‘serial_no’]) { //查询POSP中的所属代理商
$agentInfo = “”;
$agentInfoWhere[‘posp_business.serial_no’] = $value[‘serial_no’];
$agentInfo = $businessModel->field(‘posp_agent_info.company_name as agent_company_name,posp_agent_info.serial_no as agent_serial_no’)->join(‘posp_agent_info ON posp_business.agent_id = posp_agent_info.agent_id’, ‘left’)->where($agentInfoWhere)->find();
$fwcShopList[$key][‘agent_company_name’] = $agentInfo[‘agent_company_name’];
$fwcShopList[$key][‘agent_serial_no’] = $agentInfo[‘agent_serial_no’];
}
$store_number = ”;
$store_number = $this->create_storenumber($value[‘wxuser_id’]);
$fwcShopList[$key][‘store_number’] = $store_number;
//商户昨日支付宝交易额(交易成功)
//S(date(“Y-m-d”).”yesterday_weixin_”.$store_number,null) ;
if (!S(date(“Y-m-d”) . “yesterday_weixin_” . $store_number)) {
$yesterdayWeixinWhere[‘merchant_num’] = $store_number;
$yesterdayWeixinWhere[‘trans_status’] = 1;
$yesterdayWeixinWhere[‘dynamic_type’] = 1;
$yesterdayWeixinWhere[‘trans_begin’] = array(array(‘egt’, date(“Y-m-d 00:00:00”, strtotime(“-1 days”))), array(‘elt’, date(“Y-m-d 23:59:59”, strtotime(“-1 days”))), ‘and’);
$yesterdayWeixinTrace = $TraceModel->field(“IFNULL(SUM(total_fee),0.00) as total_fee,IFNULL(COUNT(*),0) as total_count”)->where($yesterdayWeixinWhere)->select();
S(date(“Y-m-d”) . “yesterday_weixin_” . $store_number, $yesterdayWeixinTrace[0], 86400);
}
$yesterday_weixin = S(date(“Y-m-d”) . “yesterday_weixin_” . $store_number);
$fwcShopList[$key][‘yesterday_weixin’] = $yesterday_weixin[‘total_fee’];
$fwcShopList[$key][‘yesterday_weixin_count’] = $yesterday_weixin[‘total_count’];
//商户昨日支付宝退款撤销交易额
//S(date(“Y-m-d”).”yesterday_weixin_del_”.$store_number,null) ;
if (!S(date(“Y-m-d”) . “yesterday_weixin_del_” . $store_number)) {
$yesterdayWeixinDelWhere[‘merchant_num’] = $store_number;
$yesterdayWeixinDelWhere[‘trans_status’] = array(‘in’, ‘2,3’);
$yesterdayWeixinDelWhere[‘dynamic_type’] = 1;
$yesterdayWeixinDelWhere[‘trans_begin’] = array(array(‘egt’, date(“Y-m-d 00:00:00”, strtotime(“-1 days”))), array(‘elt’, date(“Y-m-d 23:59:59”, strtotime(“-1 days”))), ‘and’);
$yesterdayWeixinDelTrace = $TraceModel->field(“IFNULL(SUM(total_fee),0.00) as total_fee,IFNULL(COUNT(*),0) as total_count”)->where($yesterdayWeixinDelWhere)->select();
S(date(“Y-m-d”) . “yesterday_weixin_del_” . $store_number, $yesterdayWeixinDelTrace[0], 86400);
}
$yesterday_weixin_del = S(date(“Y-m-d”) . “yesterday_weixin_del_” . $store_number);
$fwcShopList[$key][‘yesterday_weixin_del’] = $yesterday_weixin_del[‘total_fee’];
$fwcShopList[$key][‘yesterday_weixin_del_count’] = $yesterday_weixin_del[‘total_count’];
//商户昨日支付宝总交易额
$fwcShopList[$key][‘yesterday_weixin_total’] = $yesterday_weixin[‘total_fee’] + $yesterday_weixin_del[‘total_fee’];
$fwcShopList[$key][‘yesterday_weixin_total_count’] = $yesterday_weixin[‘total_count’] + $yesterday_weixin_del[‘total_count’];
}
$data = array(
‘pageStr’ => $show,
‘shopList’ => $fwcShopList
);
$this->display($data);
}
private function create_storenumber($id)
{
$limitcount = 15;
$returnstr = str_pad($id, $limitcount, “0”, STR_PAD_LEFT);
return $returnstr;
}
private function shopType($fu_category_id, $mid_category_id, $category_id)
{
/**
* $$area_array[2015062600004525]=”休闲娱乐”;
* $$sub_array[2015062600004525][2015090700039570]=”足疗按摩”;
* $$sub_array[2015062600004525][2016012000122673]=”洗浴/桑拿水会”;
* $$sub_array[2015062600004525][2016012000124191]=”网吧网咖”;
* $$sub_array[2015062600004525][2016012000126089]=”游乐游艺”;
* $$sub_array[2015062600004525][2015090700042466]=”KTV”;
* $$sub_array[2015062600004525][2016012000128641]=”密室”;
* $$sub_array[2015062600004525][2016012000129781]=”桌面游戏”;
* $$sub_array[2015062600004525][2016012000130831]=”真人CS”;
* $$sub_array[2015062600004525][2016012000127534]=”图书馆”;
*
* $$area_array[2015063000013612]=”丽人”;
* $$sub_array[2015063000013612][2015063000015529]=”美发”;
* $$sub_array[2015063000013612][2015063000019130]=”美容/SPA/美体”;
* $$sub_array[2015063000013612][2015101000066113]=”美容美发”;
* $$sub_array[2015063000013612][2015101000064159]=”美容美甲”;
* $$sub_array[2015063000013612][2015101000067631]=”美发美甲”;
* $$sub_array[2015063000013612][2015063000017354]=”美甲/护手”;
*
* $$area_array[2015110500071135]=”运动健身”;
* $$sub_array[2015110500071135][2015110500080520]=”健身中心”;
* $$sub_array[2015110500071135][2015110500078658]=”桌球馆”;
* $$sub_array[2015110500071135][2015110500078657]=”游泳馆”;
* $$sub_array[2015110500071135][2015110500073009]=”羽毛球馆”;
* $$sub_array[2015110500071135][2015110500085004]=”武术场馆”;
* $$sub_array[2015110500071135][2015110500077463]=”网球场”;
* $$sub_array[2015110500071135][2015110500074890]=”篮球场”;
* $$sub_array[2015110500071135][2015063000012448]=”溜冰场”;
* $$sub_array[2015110500071135][2015110500077464]=”乒乓球馆”;
* $$sub_array[2015110500071135][2015110500078659]=”瑜伽”;
* $$sub_array[2015110500071135][2015110500075901]=”足球场”;
*
* $$area_array[2015063000020189]=”结婚”;
* $$sub_array[2015063000020189][2016012900134880]=”婚庆公司”;
* $$sub_array[2015063000020189][2016012900136110]=”婚纱摄影”;
* $$sub_array[2015063000020189][2016012900138987]=”婚礼策划”;
* $$sub_array[2015063000020189][2016012900140916]=”婚纱礼服”;
*
* $$area_array[1]=”宠物”;
* $$sub_array[1][2016012900148581]=”宠物店(服务类)”;
* $$sub_array[1][2016012900149738]=”宠物医院”;
*
* $$area_array[2]=”亲子”;
* $$sub_array[2][2016012900143707]=”亲子游乐”;
* $$sub_array[2][2016012900145271]=”亲子摄影”;
*
* $$area_array[2015091000052157]=”超市便利店”;
* $$sub_array[2015091000052157][2015091000060134]=”便利店”;
* $$sub_array[2015091000052157][2015091000056956]=”个人护理”;
* $$sub_array[2015091000052157][2015091000058486]=”超市”;
*/
$area_array[4] = “美食”;
$sub_array[4][2016000000000001] = “中餐”;
$sub_arr[2016000000000001][2015050700000010] = “川菜”;
$sub_arr[2016000000000001][2015050700000011] = “湘菜”;
$sub_arr[2016000000000001][2015050700000012] = “湖北菜”;
$sub_arr[2016000000000001][2015050700000013] = “台湾菜”;
$sub_arr[2016000000000001][2015050700000014] = “新疆菜”;
$sub_arr[2016000000000001][2015050700000015] = “江浙菜”;
$sub_arr[2016000000000001][2015050700000016] = “云南菜”;
$sub_arr[2016000000000001][2015050700000017] = “贵州菜”;
$sub_arr[2016000000000001][2015050700000018] = “西北菜”;
$sub_arr[2016000000000001][2015050700000019] = “东北菜”;
$sub_arr[2016000000000001][2015050700000020] = “香锅/烤鱼”;
$sub_arr[2016000000000001][2015050700000021] = “海鲜”;
$sub_arr[2016000000000001][2015050700000022] = “其它地方菜”;
$sub_arr[2016000000000001][2015050700000062] = “粤菜”;
$sub_arr[2016000000000001][2015050700000019] = “湘菜”;
$sub_arr[2016000000000001][2016010600120962] = “海南菜”;
$sub_arr[2016000000000001][2016031800152626] = “鲁菜”;
$sub_arr[2016000000000001][2016031800154367] = “徽菜”;
$sub_arr[2016000000000001][2016031800154368] = “晋菜”;
$sub_arr[2016000000000001][2016031800155597] = “豫菜”;
$sub_arr[2016000000000001][2016031800156722] = “闽菜”;
$sub_arr[2016000000000001][2016031800158042] = “上海本帮菜”;
$sub_arr[2016000000000001][2016031800159500] = “淮扬菜”;
$sub_array[4][2016000000000002] = “火锅”;
$sub_arr[2016000000000002][2015050700000023] = “麻辣烫/串串香”;
$sub_arr[2016000000000002][2015050700000024] = “川味/重庆火锅”;
$sub_arr[2016000000000002][201505070000005] = “云南火锅”;
$sub_arr[2016000000000002][2015050700000026] = “老北京涮羊肉”;
$sub_arr[2016000000000002][2015050700000027] = “港式火锅”;
$sub_arr[2016000000000002][2015050700000028] = “鱼火锅”;
$sub_arr[2016000000000002][2015050700000029] = “羊蝎子”;
$sub_arr[2016000000000002][2015050700000030] = “炭火锅”;
$sub_arr[2016000000000002][2015050700000031] = “韩式火锅”;
$sub_arr[2016000000000002][2015050700000032] = “豆捞”;
$sub_arr[2016000000000002][2015050700000033] = “其它火锅”;
$sub_array[4][2016000000000003] = “烧烤”;
$sub_arr[2016000000000003][2015050700000048] = “中式烧烤”;
$sub_arr[2016000000000003][2015050700000049] = “拉美烧烤”;
$sub_arr[2016000000000003][2015050700000050] = “日式烧烤”;
$sub_arr[2016000000000003][2015050700000051] = “铁板烧”;
$sub_arr[2016000000000003][2015050700000052] = “韩式烧烤”;
$sub_arr[2016000000000003][2015050700000053] = “韩式烧烤”;
$sub_array[4][2016000000000004] = “其他美食”;
$sub_arr[2016000000000004][2015050700000048] = “自助餐”;
$sub_arr[2016000000000004][2015050700000057] = “创意菜”;
$sub_arr[2016000000000004][2015050700000058] = “西餐”;
$sub_arr[2016000000000004][2015050700000059] = “日韩料理”;
$sub_arr[2016000000000004][2015050700000060] = “东南亚菜”;
$sub_arr[2016000000000004][2015050700000061] = “素食”;
$sub_arr[2016000000000004][2015061690000027] = “其他餐饮美食”;
$sub_arr[2016000000000004][2016031800159501] = “清真菜”;
$sub_arr[2016000000000004][2016031800160959] = “茶餐厅”;
$sub_arr[2016000000000004][2016031800162476] = “土菜/农家菜”;
$sub_arr[2016000000000004][2016070500193665] = “采摘/农家乐”;
$sub_array[4][2016000000000005] = “汤/粥/煲/砂锅/炖菜”;
$sub_arr[2016000000000005][2015050700000053] = “粥”;
$sub_arr[2016000000000005][2015050700000054] = “汤”;
$sub_arr[2016000000000005][2015050700000055] = “砂锅/煲类/炖菜”;
$sub_arr[2016000000000005][2015061690000025] = “其它”;
$sub_array[4][2016000000000006] = “快餐”;
$sub_arr[2016000000000006][2015050700000038] = “西式快餐”;
$sub_arr[2016000000000006][2015050700000039] = “中式快餐”;
$sub_arr[2016000000000006][2015061690000030] = “其它快餐”;
$sub_array[4][2016000000000007] = “休闲食品”;
$sub_arr[2016000000000007][2015050700000040] = “零食”;
$sub_arr[2016000000000007][2015050700000041] = “生鲜水果”;
$sub_arr[2016000000000007][2015061690000029] = “其它休闲食品”;
$sub_arr[2016000000000007][2016062900190066] = “美食特产”;
$sub_array[4][2016000000000008] = “小吃”;
$sub_arr[2016000000000008][2015050700000034] = “熟食”;
$sub_arr[2016000000000008][2015050700000035] = “面点”;
$sub_arr[2016000000000008][2015050700000036] = “米粉/米线”;
$sub_arr[2016000000000008][2015050700000037] = “其它小吃”;
$sub_array[4][2016000000000009] = “休闲茶饮”;
$sub_arr[2016000000000009][2015050700000042] = “咖啡”;
$sub_arr[2016000000000009][2015050700000043] = “奶茶”;
$sub_arr[2016000000000009][2015050700000045] = “冰激凌”;
$sub_arr[2016000000000009][2015050700000047] = “饮品/甜点”;
$sub_arr[2016000000000009][2015062600011157] = “咖啡厅”;
$sub_arr[2016000000000009][2015091100061275] = “酒吧”;
$sub_array[4][2016000000000010] = “烘焙糕点”;
$sub_arr[2016000000000010][2015050700000044] = “蛋糕”;
$sub_arr[2016000000000010][2015050700000046] = “面包”;
$sub_arr[2016000000000010][2015061690000028] = “其它烘焙糕点”;
$area_array[2015091000052157] = “超市便利店”;
$sub_array[2015091000052157][2015091000060134] = “便利店”;
$sub_array[2015091000052157][2015091000056956] = “个人护理”;
$sub_array[2015091000052157][2015091000058486] = “超市”;
$sub_array[2015091000052157][2015091000058487] = “烟酒杂货”;
$area_array[2] = “亲子”;
$sub_array[2][2016012900143707] = “亲子游乐”;
$sub_array[2][2016051000164228] = “亲子游泳”;
$sub_array[2][2016051000167013] = “科普场馆”;
$sub_array[2][2016051000168501] = “亲子DIY”;
$sub_array[2][2016051000170050] = “早教中心”;
$sub_array[2][2016051000165496] = “幼儿外语”;
$sub_array[2][2016051000171940] = “幼儿才艺”;
$sub_array[2][2016062900190080] = “亲子服务”;
$area_array[100] = “宠物”;
$sub_array[100][2016012900148581] = “宠物店(服务类)”;
$sub_array[100][2016012900149738] = “宠物医院”;
$area_array[3] = “K歌”;
$sub_array[3][2016042200000058] = “会所型KTV”;
$sub_array[3][2015090700042466] = “量贩式KTV”;
$sub_array[3][2016062900190067] = “录音棚”;
$area_array[5] = “洗衣”;
$sub_array[5][2016051000173119] = “洗衣家纺”;
$sub_array[5][2016012900136110] = “洗鞋”;
$sub_array[5][2016012900138987] = “奢侈品养护”;
$sub_array[5][2016062900190081] = “自助洗衣”;
$area_array[6] = “摄影”;
$sub_array[6][2016012900136110] = “婚纱摄影”;
$sub_array[6][2016012900145271] = “儿童摄影”;
$sub_array[6][2016051000164227] = “孕妇摄影”;
$sub_array[6][2015063000024698] = “艺术写真”;
$sub_array[6][2016051000165495] = “证件照”;
$sub_array[6][2016051600176301] = “跟拍”;
$sub_array[6][2016063000191709] = “商业摄影”;
$area_array[7] = “爱车”;
$sub_array[7][2016062900190125] = “洗车”;
$sub_array[7][2016071200000011] = “4S店/汽车销售”;
$sub_arr[2016071200000011][2016062900190213] = “汽车销售”;
$sub_arr[2016071200000011][2016062900190214] = “二手车销售”;
$sub_array[7][2016062900190127] = “配件/车饰”;
$sub_array[7][2016062900190128] = “汽车保险”;
$sub_array[7][2016071200000012] = “维修保养”;
$sub_arr[2016071200000012][2016062900190215] = “拖车”;
$sub_arr[2016071200000012][2016062900190216] = “维修”;
$sub_arr[2016071200000012][2016062900190217] = “保养”;
$sub_array[7][2016062900190130] = “汽车美容”;
$sub_array[7][2016062900190131] = “汽车租赁”;
$sub_array[7][2016062900190132] = “停车场”;
$sub_array[7][2016062900190133] = “加油站”;
$area_array[8] = “教育培训”;
$sub_array[8][2015112300119923] = “职业技术培训”;
$sub_array[8][2016062900190282] = “外语”;
$sub_array[8][2016062900190283] = “音乐”;
$sub_array[8][2016062900190284] = “升学辅导”;
$sub_array[8][2016062900190285] = “体育”;
$sub_array[8][2016062900190286] = “美术”;
$sub_array[8][2016062900190287] = “留学”;
$sub_array[8][2016062900190288] = “驾校”;
$sub_array[8][2016062900190289] = “兴趣生活”;
$sub_array[8][2016071200000013] = “教育院校”;
$sub_arr[2016071200000013][2016062900190291] = “中小学校”;
$sub_arr[2016071200000013][2016062900190292] = “大学与学院”;
$sub_arr[2016071200000013][2016062900190293] = “成人教育/函授”;
$sub_arr[2016071200000013][2016062900190294] = “商业/文秘学校”;
$sub_arr[2016071200000013][2016062900190295] = “儿童保育/学前”;
/*$area_array[9]=”商圈综合体”;
$sub_array[9]=[];
$sub_array[9][0]=”请选择”;
$sub_array[9][2016061700187457]=”购物中心”;
$sub_array[9][2016061700185210]=”百货”;
$sub_array[9][2016061700185209]=”机场”;
$sub_array[9][2016061700186345]=”火车站”;*/
$area_array[10] = “医疗健康”;
$sub_array[10][2016071200000014] = “医院”;
$sub_arr[2016071200000014][2016062900190306] = “社区医院”;
$sub_arr[2016071200000014][2016062900190307] = “正骨医生”;
$sub_arr[2016071200000014][2016062900190308] = “按摩医生”;
$sub_arr[2016071200000014][2016062900190309] = “眼科医疗服务”;
$sub_arr[2016071200000014][2016062900190310] = “手足病医疗服务”;
$sub_arr[2016071200000014][2016062900190311] = “护理/照料服务”;
$sub_arr[2016071200000014][2016062900190312] = “公立医院”;
$sub_array[10][2016062900190298] = “中医”;
$sub_array[10][2016062900190299] = “齿科”;
$sub_array[10][2016062900190300] = “药店”;
$sub_array[10][2016062900190301] = “急救服务”;
$sub_array[10][2016062900190302] = “整形”;
$sub_array[10][2016062900190303] = “妇幼医院”;
$sub_array[10][2016062900190304] = “体检中心”;
$area_array[11] = “航旅”;
$sub_array[11][2016072000000001] = “景区”;
$sub_arr[2016072000000001][2015112300087778] = “门票”;
$sub_arr[2016072000000001][2015112300087779] = “景区生活服务”;
$sub_arr[2016072000000001][2015112300100346] = “景区购物”;
$sub_array[11][2016072000000002] = “客栈”;
$sub_arr[2016072000000002][2015112300103487] = “单体”;
$sub_arr[2016072000000002][2015112300105211] = “连锁”;
$sub_array[11][2016072000000003] = “汽车站”;
$sub_arr[2016072000000003][2015112300107119] = “汽车票”;
$sub_arr[2016072000000003][2015112300108166] = “汽车站购物”;
$sub_arr[2016072000000003][2015112300110076] = “汽车站生活服务”;
$sub_array[11][2016072000000004] = “酒店”;
$sub_arr[2016072000000004][2015112300111726] = “酒店单体”;
$sub_arr[2016072000000004][2015112300113179] = “酒店连锁”;
$sub_array[11][2015112300118105] = “旅行社”;
$sub_array[11][2016062900190313] = “酒店式公寓”;
$sub_array[11][2016071200000015] = “度假村”;
$sub_arr[2016071200000015][2016062900190330] = “度假别墅服务”;
$sub_arr[2016071200000015][2016062900190331] = “运动和娱乐露营”;
$sub_arr[2016071200000015][2016062900190332] = “活动房车和野营”;
$sub_array[11][2016071200000016] = “航空票务”;
$sub_arr[2016071200000016][2016062900190333] = “航空公司”;
$sub_arr[2016071200000016][2016062900190335] = “机票平台”;
$sub_arr[2016071200000016][2016062900190336] = “航空系统商”;
$sub_array[11][2016062900190327] = “货运代理/报关行”;
$sub_array[11][2016062900190317] = “铁路客运”;
$sub_array[11][2016062900190318] = “公共交通”;
$sub_array[11][2016062900190319] = “出租车服务”;
$sub_array[11][2016062900190320] = “长途公路客运”;
$sub_array[11][2016062900190328] = “游轮/巡游航线”;
$sub_array[11][2016062900190321] = “出租船只”;
$sub_array[11][2016062900190329] = “船舶/海运服务”;
$sub_array[11][2016062900190322] = “路桥通行费”;
$area_array[12] = “专业销售/批发”;
$sub_array[12][2016071200000017] = “汽车/运输工具”;
$sub_arr[2016071200000017][2016062900190342] = “机动车/配件批发”;
$sub_arr[2016071200000017][2016062900190343] = “活动房车销售商”;
$sub_arr[2016071200000017][2016062900190344] = “汽车轮胎经销”;
$sub_arr[2016071200000017][2016062900190345] = “汽车零配件”;
$sub_arr[2016071200000017][2016062900190346] = “船舶及配件”;
$sub_arr[2016071200000017][2016062900190347] = “拖车篷车娱乐用车”;
$sub_arr[2016071200000017][2016062900190348] = “轨道交通设备器材”;
$sub_arr[2016071200000017][2016062900190349] = “飞机/配件”;
$sub_arr[2016071200000017][2016062900190350] = “运输搬运设备”;
$sub_arr[2016071200000017][2016062900190351] = “起重装卸设备”;
$sub_arr[2016071200000017][2016062900190352] = “摩托车及配件”;
$sub_arr[2016071200000017][2016062900190353] = “电动车及配件”;
$sub_arr[2016071200000017][2016062900190354] = “露营及旅行汽车”;
$sub_arr[2016071200000017][2016062900190355] = “雪车”;
$sub_array[12][2016071200000018] = “办公用品批发”;
$sub_arr[2016071200000018][2016062900190356] = “商务家具批发”;
$sub_arr[2016071200000018][2016062900190357] = “办公器材批发”;
$sub_arr[2016071200000018][2016062900190359] = “办公用品文具批发”;
$sub_array[12][2016071200000019] = “工业产品批发零售”;
$sub_arr[2016071200000019][2016062900190360] = “金属产品/服务”;
$sub_arr[2016071200000019][2016062900190361] = “电气产品/设备”;
$sub_arr[2016071200000019][2016062900190362] = “五金器材/用品”;
$sub_arr[2016071200000019][2016062900190363] = “管道/供暖设备”;
$sub_arr[2016071200000019][2016062900190364] = “工业设备/制成品”;
$sub_arr[2016071200000019][2016062900190365] = “工业耐用品”;
$sub_arr[2016071200000019][2016062900190366] = “化工产品”;
$sub_arr[2016071200000019][2016062900190367] = “石油/石油产品”;
$sub_array[12][2016071200000020] = “药品医疗批发”;
$sub_arr[2016071200000020][2016062900190368] = “医疗器械”;
$sub_arr[2016071200000020][2016062900190369] = “药品批发商”;
$sub_arr[2016071200000020][2016062900190370] = “康复/身体辅助品”;
$area_array[13] = “政府/社会组织”;
$sub_array[13][2016071200000021] = “政府服务”;
$sub_arr[2016071200000021][2016062900190374] = “法庭费用”;
$sub_arr[2016071200000021][2016062900190375] = “行政费用和罚款”;
$sub_arr[2016071200000021][2016062900190376] = “保释金”;
$sub_arr[2016071200000021][2016062900190377] = “税务/海关”;
$sub_arr[2016071200000021][2016062900190378] = “社会保障服务”;
$sub_arr[2016071200000021][2016062900190379] = “使领馆”;
$sub_arr[2016071200000021][2016062900190380] = “国家邮政”;
$sub_arr[2016071200000021][2016062900190381] = “政府采购”;
$sub_arr[2016071200000021][2016062900190382] = “政府贷款”;
$sub_array[13][2016071200000022] = “社会组织”;
$sub_arr[2016071200000022][2016062900190383] = “慈善/社会公益”;
$sub_arr[2016071200000022][2016062900190384] = “行业协会/社团”;
$sub_arr[2016071200000022][2016062900190385] = “宗教组织”;
$sub_arr[2016071200000022][2016062900190386] = “汽车协会”;
$area_array[14] = “电影”;
$sub_array[14][2016062900190388] = “电影院”;
$sub_array[14][2016062900190389] = “私人影院”;
$area_array[2016051000175109] = “书店”;
$area_array[2015062600004525] = “休闲娱乐”;
$sub_array[2015062600004525][2015090700039570] = “足疗按摩”;
$sub_array[2015062600004525][2016012000122673] = “洗浴/桑拿水会”;
$sub_array[2015062600004525][2016012000124191] = “网吧网咖”;
$sub_array[2015062600004525][2016012000126089] = “游乐游艺”;
//$sub_array[2015062600004525][2015090700042466]=”KTV”;
$sub_array[2015062600004525][2016012000128641] = “密室”;
$sub_array[2015062600004525][2016012000129781] = “桌面游戏”;
$sub_array[2015062600004525][2015090700041394] = “棋牌休闲”;
$sub_array[2015062600004525][2015063000012448] = “中医养生”;
$sub_array[2015062600004525][2016012000130831] = “真人CS”;
$sub_array[2015062600004525][2016012000127534] = “图书馆”;
$area_array[2015063000013612] = “丽人”;
$sub_array[2015063000013612][2015063000015529] = “美发”;
$sub_array[2015063000013612][2015063000019130] = “美容/SPA/美体”;
$sub_array[2015063000013612][2015101000066113] = “美容美发”;
$sub_array[2015063000013612][2015101000064159] = “美容美甲”;
$sub_array[2015063000013612][2015101000067631] = “美发美甲”;
$sub_array[2015063000013612][2015063000017354] = “美甲/护手”;
$sub_array[2015063000013612][2016062900190068] = “彩妆造型”;
$sub_array[2015063000013612][2016062900190069] = “美睫”;
$sub_array[2015063000013612][2016062900190070] = “产后塑形”;
$area_array[2015063000020189] = “结婚”;
$sub_array[2015063000020189][2016012900134880] = “婚庆公司”;
$sub_array[2015063000020189][2016012900138987] = “婚礼策划”;
$sub_array[2015063000020189][2016012900140916] = “婚纱礼服”;
$sub_array[2015063000020189][2016062900190077] = “司仪主持”;
$sub_array[2015063000020189][2016062900190078] = “婚车租赁”;
$area_array[2015062600002758] = “购物”;
$sub_array[2015062600002758][2015062600007420] = “本地购物”;
$sub_array[2015062600002758][2015062600006253] = “烟酒”;
$sub_array[2015062600002758][2015090700035947] = “当地特色/保健品”;
$sub_array[2015062600002758][2015062600007420] = “服装饰品”;
$sub_array[2015062600002758][2015062600007184] = “服装饰品”;
$sub_arr[2015062600007184][2016062900190084] = “男性服装”;
$sub_arr[2015062600007184][2016062900190085] = “女性成衣”;
$sub_arr[2015062600007184][2016062900190086] = “内衣”;
$sub_arr[2015062600007184][2016062900190087] = “家居服”;
$sub_arr[2015062600007184][2016062900190088] = “皮草皮具”;
$sub_arr[2015062600007184][2016062900190089] = “高档时装正装定制”;
$sub_arr[2015062600007184][2016062900190090] = “裁缝”;
$sub_array[2015062600002758][2016062900190082] = “化妆品”;
$sub_array[2015062600002758][2016062900190083] = “茶叶”;
$sub_array[2015062600002758][2015062600007185] = “珠宝饰品”;
$sub_arr[2015062600007185][2016062900190097] = “珠宝”;
$sub_arr[2015062600007185][2016062900190098] = “金银”;
$sub_arr[2015062600007185][2016062900190099] = “钟表店”;
$sub_arr[2015062600007185][2016062900190100] = “剃须刀”;
$sub_arr[2015062600007185][2016062900190101] = “瑞士军刀”;
$sub_arr[2015062600007185][2016062900190102] = “烟酒具”;
$sub_arr[2015062600007185][2016062900190103] = “配饰商店”;
$sub_arr[2015062600007185][2016062900190104] = “假发”;
$sub_arr[2015062600007185][2016062900190105] = “饰物”;
$sub_array[2015062600002758][2015062600007186] = “鞋包”;
$sub_arr[2015062600007186][2016062900190107] = “鞋类”;
$sub_arr[2015062600007186][2016062900190108] = “行李箱包”;
$sub_array[2015062600002758][2016062900190109] = “亲子购物”;
$sub_array[2015062600002758][2016062900190110] = “婚礼小商品”;
$sub_array[2015062600002758][2016062900190111] = “运动户外用品”;
$sub_array[2015062600002758][2015062600007187] = “办公用品”;
$sub_arr[2015062600007187][2016062900190178] = “打字/打印/扫描”;
$sub_arr[2015062600007187][2016062900190179] = “文具”;
$sub_array[2015062600002758][2015062600007189] = “文化艺术店”;
$sub_arr[2015062600007189][2016062900190180] = “乐器”;
$sub_arr[2015062600007189][2016062900190182] = “二手商品店”;
$sub_arr[2015062600007189][2016062900190183] = “文物古董”;
$sub_arr[2015062600007189][2016062900190184] = “古玩复制品”;
$sub_arr[2015062600007189][2016062900190185] = “礼品”;
$sub_arr[2015062600007189][2016062900190186] = “卡片”;
$sub_arr[2015062600007189][2016062900190187] = “纪念品”;
$sub_arr[2015062600007189][2016062900190188] = “瓷器”;
$sub_arr[2015062600007189][2016062900190189] = “玻璃和水晶摆件”;
$sub_arr[2015062600007189][2016062900190190] = “工艺美术用品”;
$sub_arr[2015062600007189][2016062900190191] = “艺术品和画廊”;
$sub_arr[2015062600007189][2016062900190192] = “邮票/纪念币”;
$sub_arr[2015062600007189][2016062900190193] = “宗教物品”;
$sub_array[2015062600002758][2016062900190114] = “品牌折扣店”;
$sub_array[2015062600002758][2015062600007190] = “数码产品”;
$sub_arr[2015062600007190][2016062900190194] = “手机”;
$sub_arr[2015062600007190][2016062900190195] = “通讯设备”;
$sub_arr[2015062600007190][2016062900190196] = “数码产品及配件”;
$sub_arr[2015062600007190][2016062900190197] = “专业摄影器材”;
$sub_arr[2015062600007190][2016062900190198] = “计算机/服务器”;
$sub_array[2015062600002758][2016062900190116] = “家用电器”;
$sub_array[2015062600002758][2015062600007191] = “家居家纺”;
$sub_arr[2015062600007191][2016062900190199] = “草坪和花园用品”;
$sub_arr[2015062600007191][2016062900190200] = “地毯窗帘等家纺”;
$sub_arr[2015062600007191][2016062900190201] = “帷幕”;
$sub_arr[2015062600007191][2016062900190202] = “室内装潢壁炉”;
$sub_arr[2015062600007191][2016062900190203] = “屏风”;
$sub_arr[2015062600007191][2016062900190204] = “家庭装饰”;
$sub_arr[2015062600007191][2016062900190205] = “花木栽种用品”;
$sub_array[2015062600002758][2015062600007192] = “建材”;
$sub_arr[2015062600007192][2016062900190206] = “油漆”;
$sub_arr[2015062600007192][2016062900190207] = “清漆用品”;
$sub_arr[2015062600007192][2016062900190208] = “大型建材卖场卖场”;
$sub_arr[2015062600007192][2016062900190209] = “木材与建材商店”;
$sub_arr[2015062600007192][2016062900190210] = “玻璃”;
$sub_arr[2015062600007192][2016062900190211] = “墙纸”;
$sub_array[2015062600002758][2016062900190120] = “眼镜店”;
$sub_array[2015062600002758][2016070500193666] = “菜市场”;
$sub_array[2015062600002758][2016062900190212] = “成人用品”;
$sub_array[2015062600002758][2015062600007193] = “报刊/音像/书籍”;
$sub_arr[2015062600007193][2016062900190174] = “音像制品租售”;
$sub_arr[2015062600007193][2016062900190175] = “音像制品/书籍”;
$sub_arr[2015062600007193][2016062900190176] = “书籍”;
$sub_arr[2015062600007193][2016062900190177] = “报纸杂志”;
$sub_array[2015062600002758][2016062900190122] = “烟花爆竹”;
$sub_array[2015062600002758][2016062900190123] = “国外代购及免税店”;
/*
$area_array[4]=”购物”;
$sub_array[4]=[];
$sub_array[4][0]=”请选择”;
$sub_array[4][2016051000175109]=”书店”;
*/
$area_array[2015110500071135] = “运动健身”;
$sub_array[2015110500071135][2015110500080520] = “健身中心”;
$sub_array[2015110500071135][2015110500078657] = “游泳馆”;
$sub_array[2015110500071135][2015110500078659] = “瑜伽”;
$sub_array[2015110500071135][2015110500081946] = “卡丁赛车”;
$sub_array[2015110500071135][2015110500083341] = “舞蹈”;
$sub_array[2015110500071135][2015110500073009] = “羽毛球馆”;
$sub_array[2015110500071135][2015110500078658] = “桌球馆”;
$sub_array[2015110500071135][2016051600178152] = “体育场馆”;
$sub_array[2015110500071135][2015110500085004] = “武术场馆”;
$sub_array[2015110500071135][2015110500074890] = “篮球场”;
$sub_array[2015110500071135][2016051600179926] = “保龄球馆”;
$sub_array[2015110500071135][2016051600179925] = “高尔夫球场”;
$sub_array[2015110500071135][2015110500075901] = “足球场”;
$sub_array[2015110500071135][2015110500077463] = “网球场”;
$sub_array[2015110500071135][2015110500077464] = “乒乓球馆”;
$sub_array[2015110500071135][2015063000012448] = “溜冰场”;
$sub_array[2015110500071135][2016051600181795] = “排球场”;
$sub_array[2015110500071135][2016051600183429] = “壁球馆”;
$fu_category_name = $area_array[$fu_category_id];
$mid_category_name = $sub_array[$fu_category_id][$mid_category_id];
$category_name = $sub_arr[$mid_category_id][$category_id];
if (!empty($fu_category_name) && !empty($mid_category_name) && !empty($category_name)) {
return $fu_category_name . “-” . $mid_category_name . “-” . $category_name;
} elseif (!empty($fu_category_name) && !empty($mid_category_name) && empty($category_name)) {
return $fu_category_name . “-” . $mid_category_name;
} elseif ((!empty($fu_category_name) || !empty($mid_category_name)) && empty($category_name)) {
if (!empty($fu_category_name)) {
return $fu_category_name;
} elseif (!empty($mid_category_name)) {
return $$mid_category_name;
} else {
return “未选择门店类目”;
}
} else {
return “未选择门店类目”;
}
}
}
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/188513.html原文链接:https://javaforall.cn
【正版授权,激活自己账号】:
Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛
【官方授权 正版激活】:
官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...