Merge branch 'master' of 8.136.139.249:wmtx/platform into feature/add_item

master
zhengyongxing 4 years ago
commit c7730d5d06

@ -1956,9 +1956,9 @@ function excelUpStreamTemplate($data, $all_sum_money, $all_pay_amount, $big_all_
$objPHPExcel->getActiveSheet()->setCellValue('E'.$line, $value['pay_amount']);
// $objPHPExcel->getActiveSheet()->setCellValue('J'.$line, $value['sum_money']);
if ($data['pay_type'] == 2) {
$objPHPExcel->getActiveSheet()->setCellValue('J'.$line, "=E{$line}*(1-H{$line})*G{$line}*(1-I{$line})");
$objPHPExcel->getActiveSheet()->setCellValue('J'.$line, "=ROUND(E{$line}*(1-H{$line})*G{$line}*(1-I{$line}),2)");
}else{
$objPHPExcel->getActiveSheet()->setCellValue('J'.$line, "=E{$line}*(1-H{$line})*F{$line}*(1-I{$line})");
$objPHPExcel->getActiveSheet()->setCellValue('J'.$line, "=ROUND(E{$line}*(1-H{$line})*F{$line}*(1-I{$line}),2)");
}
}
@ -2088,9 +2088,9 @@ function excelSpecialComplementEmplate($data, $all_sum_money, $all_pay_amount, $
// $objPHPExcel->getActiveSheet()->setCellValue('F'.$line, $value['sum_money']);
if ($data['withdraw_type'] != 3) {
$objPHPExcel->getActiveSheet()->setCellValue('F'.$line,"=C{$line}*D{$line}*(1-E{$line})");
$objPHPExcel->getActiveSheet()->setCellValue('F'.$line,"=ROUND(C{$line}*D{$line}*(1-E{$line}),2)");
} else {
$objPHPExcel->getActiveSheet()->setCellValue('F'.$line,"=C{$line}*E{$line}");
$objPHPExcel->getActiveSheet()->setCellValue('F'.$line,"=ROUND(C{$line}*E{$line}),2)");
}
}
$objPHPExcel->getActiveSheet()->setCellValue('B'.$line, $product_name);
@ -2207,7 +2207,7 @@ function excelDownStreamTemplate($data, $all_sum_money, $all_pay_amount, $big_al
$objPHPExcel->getActiveSheet()->setCellValue('E'.$line, $value['fax_ratio'] . '%');
$objPHPExcel->getActiveSheet()->setCellValue('C'.$line, $value['pay_amount']);
// $objPHPExcel->getActiveSheet()->setCellValue('F'.$line, $value['sum_money']);
$objPHPExcel->getActiveSheet()->setCellValue('F'.$line,"=C{$line}*D{$line}*(1-E{$line})");
$objPHPExcel->getActiveSheet()->setCellValue('F'.$line,"=ROUND(C{$line}*D{$line}*(1-E{$line}),2)");
}
$objPHPExcel->getActiveSheet()->setCellValue('B'.$line, $product_name);
$line++;

@ -591,6 +591,8 @@ class CompanyStatementController extends ThinkController
$line = 1;
$count = [];
$week_line = 2;
//获取对接人
foreach($infolist as $k=>&$v){
$infolist[$k]['reward'] = 0;
@ -622,6 +624,9 @@ class CompanyStatementController extends ThinkController
$v['statement_money'] = "=ROUND(";
}
$handle_data = A("CompanyStatementPool")->changeDataStruct($v['statement_info'],$is_export,$week_line);
$v['statement_info'] = $handle_data;
$row = 0;
foreach($v['statement_info'] as $ke=>&$va){
$va['row'] = count($va['game_list']);
@ -639,12 +644,12 @@ class CompanyStatementController extends ThinkController
if($is_export){
if($v['withdraw_type'] != 3) {
$val['sum_money'] = "=ROUND(K{$line}*(L{$line}+M{$line}),2)";
$val['sum_money'] = "=ROUND((K{$line}-L{$line})*(M{$line}+N{$line}),2)";
} else {
$val['sum_money'] = "=ROUND(K{$line}*(M{$line}),2)";
$val['sum_money'] = "=ROUND((K{$line}-L{$line})*(N{$line}),2)";
}
// $val['sum_money'] = "=J{$line}*(K{$line}+L{$line})";
$v['statement_money'] .= "N{$line}+";
$v['statement_money'] .= "S{$line}+";
}else{
$count['platform_amount'] += $val['pay_amount'];
$count['sum_money'] += $val['sum_money'];
@ -674,10 +679,18 @@ class CompanyStatementController extends ThinkController
}
}
// if($is_export){
// $count["platform_amount"] = "=ROUND(SUM(K2:K".$line."),2)";
// $count["sum_money"] = "=ROUND(SUM(Q2:Q".$line."),2)";
// }
if($is_export){
$count["platform_amount"] = "=ROUND(SUM(K2:K".$line."),2)";
$count["sum_money"] = "=ROUND(SUM(Q2:Q".$line."),2)";
$count["week_money"] = "=ROUND(SUM(S2:S".$line."),2)";
$count["sum_money"] = "=ROUND(SUM(T2:T".$line."),2)";
}
$this->assign("withdraw_type",3);
$this->assign("data",$infolist);
$this->assign("count",$count);
$this->assign("is_export",$is_export);

@ -43,7 +43,8 @@ class FinancialSummaryController extends AdminController
}
public function updateStatement()
{
$temp = date('Y',time()).'-'.(date('m',time())-1);
$temp = date('Y-m',strtotime(date('Y',time()).'-'.(date('m',time())-1).'-01'));
$params = "php ".SUBSITE_INDEX." FinancialSummarySet/setMonthFinancialSummary/recount/1/count_date/{$temp}";
$r = D("CmdTasks")->addTask("FinancialSummary",$params);
if($r){

@ -623,26 +623,50 @@ class StatementMangementController extends ThinkController
public function checkRewardDetail($settlmentSet = []) {
$pool_data = M("company_statement_pool","tab_")->field('id,statement_num,create_lack_ids,verify_status,is_payment,withdraw_type,statement_begin_time,statement_end_time')
->where([
'verify_status'=>['egt',2],
'withdraw_type'=>['neq',3]
])
->select();
foreach ($settlmentSet as $key => $value) {
if ($value['company_id']) {
$sql = "(select statement_begin_time,statement_end_time,company_id,company_name from tab_company_statement
union all select statement_begin_time,statement_end_time,company_id,company_name from tab_company_statement_info
union all select statement_begin_time,statement_end_time,company_id,company_name from tab_company_lack_statement_info where is_pool=0)statement_info";
$data = M()->table("$sql")
->where(
[
'statement_begin_time'=>['elt',$value['confirm_time']],
'statement_end_time'=>['egt',$value['confirm_time']],
'company_id'=>$value['company_id']
]
)
->select();
if ($data) {
return true;
foreach ($pool_data as $pkey => $pvalue) {
$infolist = [];
if ($pvalue['verify_status'] != 6) {
//获取基本信息
$infolist = M("company_statement_info", "tab_")->field("*,'1' as st")
// ->where("pool_id = '{$pvalue['id']}'")
->where([
'statement_begin_time' => ['elt', $value['confirm_time']],
'statement_end_time' => ['egt', $value['confirm_time']],
'company_id' => $value['company_id'],
'pool_id'=>$pvalue['id'],
])
->select();
//获取母单
if (!empty($pvalue['create_lack_ids'])) {
$l_ids = explode(',',$pvalue['create_lack_ids']);
$lack_info = M("company_lack_statement_info", "tab_")
->field("*,'0' as st")
// ->where("id in ({$l_ids})")
->where([
'id'=>['in',$l_ids],
'statement_begin_time' => ['elt', $value['confirm_time']],
'statement_end_time' => ['egt', $value['confirm_time']],
'company_id' => $value['company_id'],
])
->select();
$infolist = array_merge($infolist, $lack_info);
}
if ($infolist) {
return true;
}
}
}

@ -177,7 +177,7 @@ class SpendRepository
$gameIds = $params['game_ids'] ?? [];
$conditions = $this->getGameGroupConditionsNew($params);
$field = 'game_id, sum(pay_amount) as amount';
$items = M('spend', 'tab_')->field($field)->where($conditions)->group('game_id')->select();
$items = M('spend use index(spend_search)', 'tab_')->field($field)->where($conditions)->group('game_id')->select();
return $this->assembleRecords($items, $gameIds, 'amount', 'game_id');
}
@ -187,7 +187,7 @@ class SpendRepository
public function getPayAmountByGameAndType($params)
{
$conditions = $this->getGameGroupConditionsNew($params);
return M('spend', 'tab_')->where($conditions)->sum('pay_amount');
return M('spend use index(spend_search)', 'tab_')->where($conditions)->sum('pay_amount');
}
/**
@ -234,7 +234,7 @@ class SpendRepository
$gameIds = $params['game_ids'] ?? [];
$conditions = $this->getGameGroupConditions($params);
$field = 'game_id, count(*) count';
$items = M('spend', 'tab_')->field($field)->where($conditions)->group('game_id')->select();
$items = M('spend use index(spend_search)', 'tab_')->field($field)->where($conditions)->group('game_id')->select();
return $this->assembleRecords($items, $gameIds, 'count', 'game_id');
}
@ -244,7 +244,7 @@ class SpendRepository
public function getPayCountByGame($params)
{
$conditions = $this->getGameGroupConditions($params);
return M('spend', 'tab_')->where($conditions)->count();
return M('spend use index(spend_search)', 'tab_')->where($conditions)->count();
}
/**
@ -255,7 +255,7 @@ class SpendRepository
$gameIds = $params['game_ids'] ?? [];
$conditions = $this->getGameGroupConditions($params);
$field = 'game_id, count(distinct user_id) count';
$items = M('spend', 'tab_')->field($field)->where($conditions)->group('game_id')->select();
$items = M('spend use index(spend_search)', 'tab_')->field($field)->where($conditions)->group('game_id')->select();
return $this->assembleRecords($items, $gameIds, 'count', 'game_id');
}
@ -265,7 +265,7 @@ class SpendRepository
public function getPayUserCountByGame($params)
{
$conditions = $this->getGameGroupConditions($params);
$sql = M('spend', 'tab_')->field('distinct game_id, user_id')
$sql = M('spend use index(spend_search)', 'tab_')->field('distinct game_id, user_id')
->where($conditions)
->fetchSql(true)
->select();
@ -307,7 +307,7 @@ class SpendRepository
$oldConditions['pay_time'] = ['lt', $beginTime];
$oldQuery = M('spend', 'tab_')->field('user_id')->where($oldConditions)->group('user_id')->buildSql();
$conditions['user_id'] = ['exp', ' not in (' . $oldQuery . ')'];
$items = M('spend', 'tab_')->field('count(distinct user_id) count, game_id')->where($conditions)->group('game_id')->select();
$items = M('spend use index(spend_search)', 'tab_')->field('count(distinct user_id) count, game_id')->where($conditions)->group('game_id')->select();
return $this->assembleRecords($items, $gameIds, 'count', 'game_id');
}

@ -7,8 +7,7 @@ use GuzzleHttp\Exception\RequestException;
use Base\Tool\GameResource\YzchzbClient;
use Base\Tool\GameResource\LsxxClient;
use Base\Tool\GameResource\JtxcClient;
use Base\Tool\GameResource\JxjClient;
use Base\Tool\GameResource\LeyouClient;
/**
* 游戏资源接口
@ -19,14 +18,16 @@ class GameResource
private $game;
private $clientMap = [
191 => JtxcClient::class,
192 => JtxcClient::class,
231 => LsxxClient::class,
232 => LsxxClient::class,
229 => YzchzbClient::class,
230 => YzchzbClient::class,
239 => JxjClient::class,
240 => JxjClient::class,
191 => LeyouClient::class, // 九天仙尘(安卓版)
192 => LeyouClient::class, // 九天仙尘(苹果版)
229 => YzchzbClient::class, // 远征手游之楚汉争霸(安卓版)
230 => YzchzbClient::class, // 远征手游之楚汉争霸(苹果版)
231 => LsxxClient::class, // 乱世枭雄(安卓版)
232 => LsxxClient::class, // 乱世枭雄(苹果版)
239 => LeyouClient::class, // 剑仙诀(安卓版)
240 => LeyouClient::class, // 剑仙诀(苹果版)
247 => LeyouClient::class, // 剑破长空(安卓版)
248 => LeyouClient::class, // 剑破长空(苹果版)
];
public function __construct($game)

@ -1,155 +0,0 @@
<?php
namespace Base\Tool\GameResource;
use GuzzleHttp\Client;
use GuzzleHttp\Exception\RequestException;
/**
* 剑仙诀-测试资源接口
*/
class JxjClient
{
const SIGN_NAME = 'sign';
const SUCCESS = '0000';
const KEY = '6c9VLnZFlhEppATKKWeH5vV900K6Nhy5';
protected $client;
// http://chat.leniu.com/api/game/sendGold/zhuimeng/jxlm/57972
private $apis = [
'provide' => ['uri' => '/api/game/sendGold/zhuimeng/jxlm/57972', 'method' => 'post'],
];
public function __construct()
{
$this->client = new Client([
'base_uri' => 'http://chat.leniu.com',
'timeout' => 10.0,
]);
}
public function api($api, array $params = [])
{
$api = $this->apis[$api] ?? null;
if (is_null($api)) {
throw new \Exception('接口不存在');
}
$params[self::SIGN_NAME] = $this->sign($params);
try {
return $this->request($api, $params);
} catch (\Exception $e) {
$env = C('APP_ENV', null, 'prod');
return $e->getMessage();
}
}
public function request($api, $params)
{
if ($api['method'] == 'get') {
return $this->get($api['uri'], $params);
} else {
return $this->post($api['uri'], $params);
}
}
protected function post($uri, array $params = [])
{
$response = $this->client->post($uri, [
'verify' => false,
'form_params' => $params,
]);
return (string)$response->getBody();
}
protected function get($uri, array $params = [])
{
$response = $this->client->get($uri, [
'verify' => false,
'query' => $params,
]);
return (string)$response->getBody();
}
protected function sign($params)
{
unset($params[self::SIGN_NAME]);
ksort($params);
$signRows = [];
foreach ($params as $key => $value) {
$signRows[] = $key . '=' . $value;
}
return md5(implode('&', $signRows) . self::KEY);
}
public function apply($order, $role)
{
$result = $this->api('provide', [
'role_id' => $role['role_id'],
'money' => intval($order['ref_amount']) * 10,
'type' => 2,
// 'goods_id' => 0,
'server_no' => $role['server_id'],
]);
if ($result == 'SUCCESS') {
return [
'status' => true,
'message' => $result,
'result' => ['result' => $result]
];
} else {
return [
'status' => false,
'message' => $result,
'result' => ['result' => $result]
];
}
}
public function getResourceTypes($deviceType)
{
if ($deviceType == 'andriod') {
return [['id' => 1, 'name' => '通用', 'device_type' => 'andriod']];
} elseif ($deviceType == 'ios') {
return [['id' => 2, 'name' => '通用', 'device_type' => 'ios']];
}
}
public function getResources($typeId, $deviceType)
{
return [
1 => ['ref_id' => 1, 'name' => '60元宝', 'amount' => 6],
2 => ['ref_id' => 2, 'name' => '300元宝', 'amount' => 30],
3 => ['ref_id' => 3, 'name' => '980元宝', 'amount' => 98],
4 => ['ref_id' => 4, 'name' => '1280元宝', 'amount' => 128],
5 => ['ref_id' => 5, 'name' => '1980元宝', 'amount' => 198],
6 => ['ref_id' => 6, 'name' => '3280元宝', 'amount' => 328],
7 => ['ref_id' => 7, 'name' => '6480元宝', 'amount' => 648],
8 => ['ref_id' => 8, 'name' => '10000元宝', 'amount' => 1000],
9 => ['ref_id' => 9, 'name' => '20000元宝', 'amount' => 2000],
10 => ['ref_id' => 10, 'name' => '30000元宝', 'amount' => 3000],
11 => ['ref_id' => 11, 'name' => '50000元宝', 'amount' => 5000],
12 => ['ref_id' => 12, 'name' => '100000元宝', 'amount' => 10000],
13 => ['ref_id' => 13, 'name' => '200000元宝', 'amount' => 20000],
14 => ['ref_id' => 14, 'name' => '680元宝', 'amount' => 68],
];
/* return [
['ref_id' => 121209, 'name' => '6元充值卡', 'amount' => 6],
['ref_id' => 121210, 'name' => '30元充值卡', 'amount' => 30],
['ref_id' => 121211, 'name' => '98元充值卡', 'amount' => 98],
['ref_id' => 121212, 'name' => '128元充值卡', 'amount' => 128],
['ref_id' => 121213, 'name' => '198元充值卡', 'amount' => 198],
['ref_id' => 121214, 'name' => '328元充值卡', 'amount' => 328],
['ref_id' => 121215, 'name' => '648元充值卡', 'amount' => 648],
['ref_id' => 121216, 'name' => '1000元充值卡', 'amount' => 1000],
['ref_id' => 121217, 'name' => '2000元充值卡', 'amount' => 2000],
['ref_id' => 121218, 'name' => '3000元充值卡', 'amount' => 3000],
['ref_id' => 121219, 'name' => '5000元充值卡', 'amount' => 5000],
['ref_id' => 121220, 'name' => '10000元充值卡', 'amount' => 10000],
['ref_id' => 121221, 'name' => '20000元充值卡', 'amount' => 20000],
['ref_id' => 121222, 'name' => '68元充值卡', 'amount' => 68],
]; */
}
}

@ -6,9 +6,9 @@ use GuzzleHttp\Client;
use GuzzleHttp\Exception\RequestException;
/**
* 九天仙尘-测试资源接口
* 乐游-通用测试资源接口
*/
class JtxcClient
class LeyouClient
{
const SIGN_NAME = 'sign';
const SUCCESS = '0000';

@ -1326,6 +1326,7 @@ class QueryController extends BaseController
$promoteService = new PromoteService();
$allGameIs = $promoteService->getHistoryGameIds($loginPromote);
if ($allGameIs && count($allGameIs) > 0) {
$map['_string'] .= ' and id in(' . implode(',', $allGameIs) . ')';
} else {

@ -2022,7 +2022,7 @@ function excelDownStreamTemplate($data, $all_sum_money, $all_pay_amount, $big_al
$objPHPExcel->getActiveSheet()->setCellValue('E'.$line, $value['fax_ratio'] . '%');
$objPHPExcel->getActiveSheet()->setCellValue('C'.$line, $value['pay_amount']);
// $objPHPExcel->getActiveSheet()->setCellValue('F'.$line, $value['sum_money']);
$objPHPExcel->getActiveSheet()->setCellValue('F'.$line,"=C{$line}*D{$line}*(1-E{$line})");
$objPHPExcel->getActiveSheet()->setCellValue('F'.$line,"=ROUND(C{$line}*D{$line}*(1-E{$line}),2)");
}
$objPHPExcel->getActiveSheet()->setCellValue('B'.$line, $product_name);
$pay_amount_str .= "F{$line}+";

Loading…
Cancel
Save