From d5a63a7849087ed0b56c7dfe37beec143d4e8db3 Mon Sep 17 00:00:00 2001
From: chenxiaojun <956334972@qq.com>
Date: Mon, 10 Feb 2020 14:14:40 +0800
Subject: [PATCH 1/2] =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=90=8E=E5=8F=B0>?=
 =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=91=98>=E7=BB=93=E7=AE=97=E7=AE=A1?=
 =?UTF-8?q?=E7=90=86>=E6=8E=A8=E5=B9=BF=E6=8F=90=E7=8E=B0>=E8=87=AA?=
 =?UTF-8?q?=E5=8A=A8=E5=AE=A1=E6=A0=B8=E7=AE=A1=E7=90=86--=E6=9B=B4?=
 =?UTF-8?q?=E6=96=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 Application/Admin/Controller/QueryController.class.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Application/Admin/Controller/QueryController.class.php b/Application/Admin/Controller/QueryController.class.php
index 544d7eb71..63c99a420 100644
--- a/Application/Admin/Controller/QueryController.class.php
+++ b/Application/Admin/Controller/QueryController.class.php
@@ -1770,7 +1770,7 @@ class QueryController extends ThinkController
             $records = [];
             if (!empty($promotes)) {
                 foreach ($promotes as $promote) {
-                    $promote['company_name'] = $companyList[$promote['company_id']] ?? '未知';
+                    $promote['company_name'] = ($companyList[$promote['company_id']] ? $companyList[$promote['company_id']] : ($promote['company_id'] == 0 ? '万盟天下科技' : '未知'));
                     if ($promote['auto_review_withdraw_status'] == 0) {
                         $className = 'auto-closed';
                         $text = '关闭';

From 2c52bccaf7f06152005f3e2903ce9a5e7ced5f87 Mon Sep 17 00:00:00 2001
From: chenxiaojun <956334972@qq.com>
Date: Mon, 10 Feb 2020 16:30:46 +0800
Subject: [PATCH 2/2] =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=90=8E=E5=8F=B0>?=
 =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=91=98>=E7=BB=93=E7=AE=97=E7=AE=A1?=
 =?UTF-8?q?=E7=90=86>=E6=8E=A8=E5=B9=BF=E6=8F=90=E7=8E=B0>=E8=87=AA?=
 =?UTF-8?q?=E5=8A=A8=E5=AE=A1=E6=A0=B8=E7=AE=A1=E7=90=86--=E6=9B=B4?=
 =?UTF-8?q?=E6=96=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../Controller/QueryController.class.php      |  9 ++++-
 .../Admin/Model/WithdrawModel.class.php       | 33 +++++++++++++++++--
 Application/Admin/View/Query/withdraw.html    | 10 ++++++
 Data/update.sql                               |  3 ++
 4 files changed, 51 insertions(+), 4 deletions(-)

diff --git a/Application/Admin/Controller/QueryController.class.php b/Application/Admin/Controller/QueryController.class.php
index 63c99a420..4f558fbcf 100644
--- a/Application/Admin/Controller/QueryController.class.php
+++ b/Application/Admin/Controller/QueryController.class.php
@@ -1007,6 +1007,7 @@ class QueryController extends ThinkController
     {
         $page = I('p', 1);
         $row = I('row', 10);
+        $reviewTypeList = WithdrawModel::$reviewTypeList;
         $map['_string'] = '1=1';
         $adminid = C('USER_ADMINISTRATOR');//获取超管id
         $adminmobile = M('UcenterMember')->field('mobile')->find($adminid);
@@ -1023,6 +1024,9 @@ class QueryController extends ThinkController
         if (isset($_REQUEST['settlement_type'])) {
             $map['settlement_type'] = $_REQUEST['settlement_type'];
         }
+        if (isset($_REQUEST['review_type'])) {
+            $map['review_type'] = $_REQUEST['review_type'];
+        }
         if (isset($_REQUEST['promote_account'])) {
             if ($_REQUEST['promote_account'] == '全部') {
                 unset($_REQUEST['promote_account']);
@@ -1052,7 +1056,7 @@ class QueryController extends ThinkController
             }
         }
 
-        $fields = 'id, widthdraw_number, sum_money, promote_id, promote_account, op_id, op_type, last_op_id, last_op_type, settlement_type, settlement_begin_time, settlement_end_time, create_time, status, respond, audit_time';
+        $fields = 'id, widthdraw_number, sum_money, promote_id, promote_account, op_id, op_type, last_op_id, last_op_type, settlement_type, settlement_begin_time, settlement_end_time, create_time, status, respond, audit_time, review_type';
         $count = 0;
         if (I('export', 0) == 1) {
             $records = D('withdraw')->field($fields)
@@ -1093,6 +1097,7 @@ class QueryController extends ThinkController
                     'last_op_id_text' => $this->getOpTypeText($record['last_op_type'], $record['last_op_id']),
                     'op_type_text' => getPromoteWithdrawOpType($record['op_type']),
                     'last_op_type_text' => getPromoteWithdrawOpType($record['last_op_type']),
+                    'review_type_text' => $reviewTypeList[$record['review_type']] ?? '未知',
                     'settlement_type_text' => getPromoteWithdrawSettlementType($record['settlement_type']),
                     'settlement_begin_time' => $record['settlement_begin_time'] ? date('Y-m-d H:i:s', $record['settlement_begin_time']) : '--',
                     'settlement_end_time' => date('Y-m-d H:i:s', $record['settlement_end_time']),
@@ -1118,6 +1123,7 @@ class QueryController extends ThinkController
                     'op_type_text' => '操作人类型',
                     'last_op_id_text' => '最后操作人',
                     'last_op_type_text' => '最后操作人类型',
+                    'review_type_text' => '审核模式',
                     'settlement_type_text' => '提现模式',
                     'settlement_begin_time' => '结算开始时间',
                     'settlement_end_time' => '结算截止时间',
@@ -1153,6 +1159,7 @@ class QueryController extends ThinkController
         setPowerPromoteIds($map);
         $companys = getPromoteCompanys();
         $this->assign('companys', $companys);
+        $this->assign('reviewTypeList', $reviewTypeList);
         $this->assign('is_admin', is_administrator());
         $this->assign('list_data', $datas);
         $this->display();
diff --git a/Application/Admin/Model/WithdrawModel.class.php b/Application/Admin/Model/WithdrawModel.class.php
index 7db178856..75b82fb75 100644
--- a/Application/Admin/Model/WithdrawModel.class.php
+++ b/Application/Admin/Model/WithdrawModel.class.php
@@ -26,6 +26,10 @@ class WithdrawModel extends Model{
     const SETTLEMENT_TYPE_RECOUP = 3;
     const SETTLEMENT_TYPE_OTHER = 9;
 
+    //审核模式
+    const REVIEW_TYPE_MANUAL = 1;
+    const REVIEW_TYPE_AUTO = 2;
+
 	/**
      * 构造函数
      * @param string $name 模型名称
@@ -51,6 +55,11 @@ class WithdrawModel extends Model{
         self::SETTLEMENT_TYPE_RECOUP => '补点',
         self::SETTLEMENT_TYPE_OTHER => '其他',
     ];
+
+    public static $reviewTypeList = [
+        self::REVIEW_TYPE_MANUAL => '人工审核',
+        self::REVIEW_TYPE_AUTO => '自动审核',
+    ];
 	
 	/*
 	 * 开发者提现未处理列表
@@ -193,7 +202,13 @@ class WithdrawModel extends Model{
         $add['promote_id'] = $promote['id'];
         $add['promote_account'] = $promote['account'];
         $add['create_time'] = $thisTime;
-        $add['status'] = ($promote['auto_review_withdraw_status'] == 1) ? 1 : 0;
+        if ($promote['auto_review_withdraw_status'] == 1) {
+            $add['status'] = 1;
+            $add['review_type'] = 2;
+        } else {
+            $add['status'] = 0;
+            $add['review_type'] = 1;
+        }
         $add['widthdraw_number'] = D('withdraw')->produceWithdrawNumber(1);
         $add['settlement_begin_time'] = $settlementBeginTime;
         $add['settlement_end_time'] = $settlementEndTime;
@@ -329,7 +344,13 @@ class WithdrawModel extends Model{
         $add['promote_id'] = $promote['id'];
         $add['promote_account'] = $promote['account'];
         $add['create_time'] = $thisTime;
-        $add['status'] = ($promote['auto_review_withdraw_status'] == 1) ? 1 : 0;
+        if ($promote['auto_review_withdraw_status'] == 1) {
+            $add['status'] = 1;
+            $add['review_type'] = 2;
+        } else {
+            $add['status'] = 0;
+            $add['review_type'] = 1;
+        }
         $add['widthdraw_number'] = D('withdraw')->produceWithdrawNumber(2);
         $add['settlement_begin_time'] = $settlementBeginTime;
         $add['settlement_end_time'] = $settlementEndTime;
@@ -447,7 +468,13 @@ class WithdrawModel extends Model{
         $add['promote_id'] = $promote['id'];
         $add['promote_account'] = $promote['account'];
         $add['create_time'] = $thisTime;
-        $add['status'] = ($promote['auto_review_withdraw_status'] == 1) ? 1 : 0;
+        if ($promote['auto_review_withdraw_status'] == 1) {
+            $add['status'] = 1;
+            $add['review_type'] = 2;
+        } else {
+            $add['status'] = 0;
+            $add['review_type'] = 1;
+        }
         $add['widthdraw_number'] = D('withdraw')->produceWithdrawNumber(3);
         $add['settlement_begin_time'] = $settlementBeginTime;
         $add['settlement_end_time'] = $settlementEndTime;
diff --git a/Application/Admin/View/Query/withdraw.html b/Application/Admin/View/Query/withdraw.html
index 2946f9515..9932b2f13 100644
--- a/Application/Admin/View/Query/withdraw.html
+++ b/Application/Admin/View/Query/withdraw.html
@@ -111,6 +111,14 @@
                     <?php endforeach;?>
                 </select>
             </div>
+            <div class="input-list">
+                <select name="review_type" class="select_gallery">
+                    <option value="">审核模式</option>
+                    <?php foreach ($reviewTypeList as $key => $value) :?>
+                    <option value="<?=$key?>"><?=$value?></option>
+                    <?php endforeach;?>
+                </select>
+            </div>
             <input type="hidden" name="" value="" class="sortBy">
             <div class="input-list">
                 <a class="sch-btn" href="javascript:;" id="search" url="{:U('Query/withdraw','model='.$model['name'] .'&row='.I('row'),false)}">搜索</a>
@@ -139,6 +147,7 @@
                     <th>操作人类型</th>
                     <th>最后操作人</th>
                     <th>最后操作人类型</th>
+                    <th>审核模式</th>
                     <th>提现模式</th>
                     <th>结算开始时间</th>
                     <th>结算截止时间</th>
@@ -175,6 +184,7 @@
                             <td>{$data.op_type_text}</td>
                             <td>{$data.last_op_id_text}</td>
                             <td>{$data.last_op_type_text}</td>
+                            <td>{$data.review_type_text}</td>
                             <td>{$data.settlement_type_text}</td>
                             <td>{$data.settlement_begin_time}</td>
                             <td>{$data.settlement_end_time}</td>
diff --git a/Data/update.sql b/Data/update.sql
index ec88bb531..36e91ea72 100644
--- a/Data/update.sql
+++ b/Data/update.sql
@@ -1154,3 +1154,6 @@ MODIFY COLUMN `company_belong`  tinyint(1) UNSIGNED NOT NULL DEFAULT 3 COMMENT '
 MODIFY COLUMN `company_relation`  tinyint(1) UNSIGNED NOT NULL DEFAULT 2 COMMENT '工会关系:0-自主开发及维护;1-只维护 2 无' AFTER `company_belong`;
 ADD COLUMN `company_type`  tinyint(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '工会类型 1公司 2个人' AFTER `can_view_recharge`;
 
+-- 2020-02-10 cxj 推广提现--新增审核模式
+ALTER TABLE `tab_withdraw`
+ADD COLUMN `review_type` tinyint(3) NOT NULL DEFAULT 1 COMMENT '审核模式:1-人工审核 2-自动审核';
\ No newline at end of file