74 行
2.0 KiB
PHP
可执行文件
74 行
2.0 KiB
PHP
可执行文件
<?php
|
|
|
|
namespace Retail\Controller;
|
|
|
|
use Retail\Business\Vip;
|
|
|
|
//[1.7.90]
|
|
class VipbalanceController extends BaseController
|
|
{
|
|
/**
|
|
* 余额记录页面
|
|
*/
|
|
public function index()
|
|
{
|
|
$this->display();
|
|
}
|
|
|
|
/**
|
|
* 获取余额统计
|
|
*/
|
|
public function getBalanceTotal()
|
|
{
|
|
$vipClass = new Vip();
|
|
$param['req_data'] = I('post.req_data'); // 搜索条件
|
|
$param['merchant_id'] = $this->merchant_id;
|
|
$result = $vipClass->getBalanceTotal($param);
|
|
$this->ajaxReturn($result);
|
|
}
|
|
|
|
/**
|
|
* 获取余额记录
|
|
*/
|
|
public function balanceList()
|
|
{
|
|
$param['req_data'] = I('post.req_data'); // 搜索条件
|
|
$param['merchant_id'] = $this->merchant_id;
|
|
$param['page'] = I('post.page') ? I('post.page') : 1;
|
|
$param['limit'] = I('post.limit') ? I('post.limit') : 10;
|
|
$vipClass = new Vip();
|
|
$result = $vipClass->getBalanceList($param);
|
|
$this->ajaxReturn($result);
|
|
}
|
|
|
|
|
|
public function balanceExport()
|
|
{
|
|
$param['req_data'] = I('get.req_data'); // 搜索条件
|
|
$param['merchant_id'] = $this->merchant_id;
|
|
$param['is_export'] = 1;
|
|
$vipClass = new Vip();
|
|
$result = $vipClass->getBalanceList($param);
|
|
|
|
$file_name = "会员余额记录";
|
|
$str = $file_name . "导出时间:" . date('Y-m-d H:i:s', time());
|
|
$head_arr = [
|
|
['index', '序号'],
|
|
['name', '姓名'],
|
|
['nickname', '昵称'],
|
|
['mobile_phone', '手机号'],
|
|
['card_key', '实体卡'],
|
|
['scene_name', '场景'],
|
|
['type_name', '类型'],
|
|
['recharge_mode', '方式'],
|
|
['money', '使用金额'],
|
|
['give_money', '赠送金额'],
|
|
['all_money', '总金额'],
|
|
['add_time', '时间'],
|
|
['store_name', '门店'],
|
|
['remark', '备注'],
|
|
];
|
|
getExcel($file_name, $head_arr, $result['data']['list'], $str);
|
|
}
|
|
}
|