Merge branch 'feature/admin_optimize' into release

master
liuweiwen 5 years ago
commit f9fe74986c

@ -2135,5 +2135,42 @@ function getPromoteGameRatio($promoteID = 0, $relationGameId = 0, $amount=0, $ti
}
return $ratio;
}
//验证账号
function checkAccount($type,$account) {
// $type = I('type');
// $account = I('account');
$map = [];
$map['account'] = $account;
if ($type == 1) {
$result = M('promote','tab_')->field('account')->where($map)->find();
} else {
$result = M('user','tab_')->field('account')->where($map)->find();
}
if ($result) {
return 1;
} else {
return 0;
}
}
//去重函数
function a_array_unique($array){
$out = array();
foreach ($array as $key=>$value) {
if (!in_array($value, $out)){
$out[$key] = $value;
}
}
$out = array_values($out);
return $out;
}
?>

@ -155,8 +155,11 @@ class PartnerController extends ThinkController
$value['settlement_type'] = '月结';
}
$value['company_type'] = $value['company_type'] == 2 ? '个人' : '公司';
$value['contract_time'] = time_format($value['contract_start_time'], 'Y/m/d') . '-' .
time_format($value['contract_end_time'], 'Y/m/d');
$contract_start_time = $value['contract_start_time'] ?
time_format($value['contract_start_time'], 'Y/m/d') : '-';
$contract_end_time = $value['contract_end_time'] ?
time_format($value['contract_end_time'], 'Y/m/d') : '-';
$value['contract_time'] = $contract_start_time . '-' . $contract_end_time;
$row2 = array_sum(array_column($value['game'], 'row')) ;
$value['row'] = empty($row2) ? 1: $row2;
$parseData[$value['partner_id']][] = $value;

@ -294,11 +294,19 @@ class StatementMangementController extends ThinkController
if ($accounts) {
foreach ($accounts as $index => $account) {
$data['accounts'][] = array_merge(['account'=>$account], ['user_type'=>$user_types[$index]]);
if (checkAccount($user_types[$index],$account)==1) {
$data['accounts'][] = array_merge(['account'=>$account], ['user_type'=>$user_types[$index]]);
} else {
return $this->error('账号'.$account.'不存在,请重新输入');
}
// $data['accounts'][] = array_merge(['account'=>$account], ['user_type'=>$user_types[$index]]);
}
} else {
$data['accounts'] = [];
}
$data['accounts']=a_array_unique($data['accounts']);
// dump($data['accounts']);die();
$data['accounts'] = json_encode($data['accounts']);
if (!is_numeric(I('money'))) {
return $this->error('请输入正确的金额');

@ -157,7 +157,7 @@
</script>
<script type="text/javascript">
//导航高亮
highlight_subnav("{:U('lists')}");
highlight_subnav("{:U('Tool/company_info')}");
$(function(){
//搜索功能
$("#search").click(function(){

@ -1171,7 +1171,7 @@ CREATE TABLE `tab_reward_record` (
`creater_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建者ID',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
-- 2020-02-10 liuweiwen 内部公司信息
CREATE TABLE `tab_company_info` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`partner` varchar(60) NOT NULL COMMENT '合作方名称',

Loading…
Cancel
Save