From c0fe59864c401511ff50c06eedbfb9b0a3645815 Mon Sep 17 00:00:00 2001
From: ELF <360197197@qq.com>
Date: Tue, 11 Aug 2020 20:29:11 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Application/Common/Common/extend.php | 10 +-
.../TestingResourceController.class.php | 21 ++--
.../View/default/TestingResource/apply.html | 96 +++++++++++++++++++
.../View/default/TestingResource/index.html | 37 +++++--
4 files changed, 150 insertions(+), 14 deletions(-)
create mode 100644 Application/Home/View/default/TestingResource/apply.html
diff --git a/Application/Common/Common/extend.php b/Application/Common/Common/extend.php
index 6a50765dc..79d5ba2c7 100644
--- a/Application/Common/Common/extend.php
+++ b/Application/Common/Common/extend.php
@@ -833,7 +833,15 @@ function Status_recovery($msg){
if (empty($str)) {return $title;}
$find = array('%webname%','%gamename%','%newsname%','%giftname%','%gametype%', '%catetitle%', '%gamedevice%');
- $replace = array($title,$array['game_name'],$array['news_title'],$array['giftbag_name'],$array['game_type_name'],$array['cate_title'],$array['game_device']);
+ $replace = array(
+ $title,
+ $array['game_name'] ?? '',
+ $array['news_title'] ?? '',
+ $array['giftbag_name'] ?? '',
+ $array['game_type_name'] ?? '',
+ $array['cate_title'] ?? '',
+ $array['game_device'] ?? ''
+ );
$str = str_replace($find,$replace,$str);
return preg_replace('/((-|_)+)?((%[0-9A-Za-z_]*%)|%+)((-|_)+)?/','',$str);
diff --git a/Application/Home/Controller/TestingResourceController.class.php b/Application/Home/Controller/TestingResourceController.class.php
index 496e2fa65..564f08db1 100644
--- a/Application/Home/Controller/TestingResourceController.class.php
+++ b/Application/Home/Controller/TestingResourceController.class.php
@@ -23,7 +23,6 @@ class TestingResourceController extends BaseController
$conditions = [];
$subConditions = [
- '_string' => 'user_id = tab_user_play_info.user_id',
'promote_id' => $loginPromote['id'],
];
@@ -34,8 +33,8 @@ class TestingResourceController extends BaseController
$subConditions['create_time'] = ['elt', strtotime($createTimeEnd . ' 23:59:59')];
}
- $subSql = M('testing_user', 'tab_')->field(['1'])->where($subConditions)->select(false);
- $strCondition = 'exists (' . $subSql . ')';
+ $subSql = M('testing_user', 'tab_')->field(['user_id'])->where($subConditions)->select(false);
+ $strCondition = 'user_id in (' . $subSql . ')';
if ($account) {
$user = M('user', 'tab_')->field(['id'])->where('account like ' . $account . '%')->find();
@@ -69,7 +68,7 @@ class TestingResourceController extends BaseController
if (count($roles) > 0) {
$users = M('user', 'tab_')->field(['id', 'phone'])->where(['id' => ['in', $userIds]])->select();
$uesrs = index_by_column('id', $users);
- $bindings = M('testing_binding', 'tab_')->field()->where(['role_id' => ['in', $roleIds]])->select();
+ $bindings = M('testing_binding', 'tab_')->where(['role_id' => ['in', $roleIds]])->select();
$bindings = index_by_column('role_id', $bindings);
$bindingRoleIds = array_column($bindings, 'bind_role_id');
if (count($bindings) > 0) {
@@ -115,12 +114,13 @@ class TestingResourceController extends BaseController
{
$loginPromote = $this->getLoginPromote();
$accountsStr = trim(I('accounts', ''), ',');
- if ($accountsStr = '') {
+ if ($accountsStr == '') {
return $this->ajaxReturn(['status' => 0, 'message' => '请输入测试资源账号']);
}
$accounts = explode(',', $accountsStr);
$accounts = array_unique($accounts);
$existAccounts = M('testing_user', 'tab_')->where(['user_account' => ['in', $accounts]])->getField('user_account', true);
+ $existAccounts = $existAccounts ?? [];
$existCount = count($existAccounts);
$newAccounts = array_diff($accounts, $existAccounts);
$errorCount = 0;
@@ -145,7 +145,7 @@ class TestingResourceController extends BaseController
$successCount ++;
}
}
- return $this->ajaxReturn(['status' => 1, 'message' => '请输入测试资源账号', 'data' => [
+ return $this->ajaxReturn(['status' => 1, 'message' => '请求成功', 'data' => [
'errorCount' => $errorCount,
'successCount' => $successCount,
'existCount' => $existCount,
@@ -196,6 +196,15 @@ class TestingResourceController extends BaseController
}
public function apply()
+ {
+ $records = [];
+ $pagination = '';
+ $this->assign('records', $records);
+ $this->assign('pagination', $pagination);
+ $this->display();
+ }
+
+ public function doApply()
{
$records = I('records', []);
$batchNo = '';
diff --git a/Application/Home/View/default/TestingResource/apply.html b/Application/Home/View/default/TestingResource/apply.html
new file mode 100644
index 000000000..f1e997459
--- /dev/null
+++ b/Application/Home/View/default/TestingResource/apply.html
@@ -0,0 +1,96 @@
+
+
+
+
+
+ 资源类型
+ 资源内容
+ 资源价值
+ 资源数量
+ 备注
+ +
+ -
+
+
+
+
+
+ 198
+
+
+
+
+