xiaoyu 2 年之前
父节点
当前提交
e074c7033b

+ 9 - 3
admin/control/provider.php

@@ -639,7 +639,11 @@ class providerControl extends SystemControl
                 $pid = $item[1];
                 $data[$co_id][$pid] = $remit;
             }
+            if(empty($data)) {
+                showMessage('未提交数据');
+            }
             $this->remit_commit($data, $refill_company);
+            showMessage('操作成功', 'index.php?act=refill_company&op=remit_record');
         }
         else
         {
@@ -702,7 +706,7 @@ class providerControl extends SystemControl
 
     private function remit_commit($items, $refill_company)
     {
-        $mod = Model('');
+        $mod = Model('refill_company');
         $admininfo = $this->getAdminInfo();
         $provider_list = $this->providers();
         foreach ($provider_list as $provider) {
@@ -736,8 +740,8 @@ class providerControl extends SystemControl
                     'operation' => $admininfo['name'],
                     'add_time' => $cur_time
                 ];
-                Model('')->table('refill_company_remit')->insert($remit_record);
-                for ($i = $remit_total / $remit_max; $i<=0; $i--)
+                Model('refill_company_remit')->addRemit($remit_record);
+                for ($i = $remit_total / $remit_max; $i>=0; --$i)
                 {
                     if($i == 0) {
                         $refill_company[$co_id]['money'] = $remit_total % $remit_max;
@@ -786,6 +790,7 @@ class providerControl extends SystemControl
 
         //data
         foreach ($remit_data as $key => $data) {
+            if($data['money'] <= 0) continue;
             $tmp = [];
             $tmp[] = ['data' => $key+1];
             $tmp[] = ['data' => $data['bank_username']];
@@ -801,5 +806,6 @@ class providerControl extends SystemControl
         $excel_obj->addArray($excel_data);
         $excel_obj->addWorksheet($excel_obj->charset(L('exp_od_order'), CHARSET));
         $excel_obj->generateXML('批量打款-' . date('Y-m-d-H', time()));
+        showMessage('操作成功', 'index.php?act=refill_company&op=remit_record');
     }
 }

+ 23 - 0
admin/control/refill_company.php

@@ -104,6 +104,7 @@ class refill_companyControl extends SystemControl
     {
         if(chksubmit())
         {
+            unset($_POST['form_submit']);
             $cache = [];
             foreach ($_POST as $key => $value) {
                 $cache[$key] = $value;
@@ -123,4 +124,26 @@ class refill_companyControl extends SystemControl
             Tpl::showpage('remit.config');
         }
     }
+
+    public function remit_recordOp()
+    {
+        $mod_remit = Model('refill_company_remit');
+        $cond = [];
+        $start_unixtime = intval(strtotime($_GET['query_start_time']));
+        $end_unixtime = intval(strtotime($_GET['query_end_time']));
+        if ($start_unixtime > 0 && $end_unixtime > $start_unixtime) {
+            $cond['add_time'] = [['egt', $start_unixtime], ['lt', $end_unixtime], 'and'];
+        } elseif ($start_unixtime > 0) {
+            $cond['add_time'] = ['egt', $start_unixtime];
+        } elseif ($end_unixtime > 0) {
+            $cond['add_time'] = ['lt', $end_unixtime];
+        }
+        $list = $mod_remit->getRemitList($cond);
+        $refill_company = $this->refill_companys([]);
+
+        Tpl::output('list', $list);
+        Tpl::output('refill_company', $refill_company);
+        Tpl::output('show_page', $mod_remit->showpage());
+        Tpl::showpage('refill.company.remit');
+    }
 }

+ 3 - 1
admin/templates/default/refill.company.add.php

@@ -27,7 +27,9 @@
             <h3>公司信息管理</h3>
             <ul class="tab-base">
                 <li><a href="index.php?act=refill_company&op=index"><span>上游信息管理</span></a></li>
-                <li><a href="JavaScript:void(0);" class="current"><span>新增</span></a></li>
+                <li><a href="JavaScript:void(0);" class="current"><span>新增</span></a>
+                <li><a href="index.php?act=refill_company&op=remit_cfg"><span>打款配置</span></a></li>
+                <li><a href="index.php?act=refill_company&op=remit_record"><span>公司打款记录</span></a></li>
             </ul>
         </div>
     </div>

+ 2 - 0
admin/templates/default/refill.company.edit.php

@@ -28,6 +28,8 @@
             <ul class="tab-base">
                 <li><a href="index.php?act=refill_company&op=index"><span>上游信息管理</span></a></li>
                 <li><a href="JavaScript:void(0);" class="current"><span>编辑</span></a></li>
+                <li><a href="index.php?act=refill_company&op=remit_cfg"><span>打款配置</span></a></li>
+                <li><a href="index.php?act=refill_company&op=remit_record"><span>公司打款记录</span></a></li>
             </ul>
         </div>
     </div>

+ 1 - 0
admin/templates/default/refill.company.php

@@ -23,6 +23,7 @@
                 <li><a href="JavaScript:void(0);" class="current"><span>公司信息管理</span></a></li>
                 <li><a href="index.php?act=refill_company&op=add"><span>新增</span></a></li>
                 <li><a href="index.php?act=refill_company&op=remit_cfg"><span>打款配置</span></a></li>
+                <li><a href="index.php?act=refill_company&op=remit_record"><span>公司打款记录</span></a></li>
             </ul>
         </div>
     </div>

+ 157 - 0
admin/templates/default/refill.company.remit.php

@@ -0,0 +1,157 @@
+<?php defined('InShopNC') or exit('Access Invalid!'); ?>
+<style>
+    .page .fixed-bar .item-title h3 {
+        margin-top:18px !important;
+        margin-bottom:10px !important;
+        font-weight:700 !important;
+    }
+    .tab-base li span {
+        font-size:12px !important;
+    }
+    .layui-form-select .layui-input {
+        height:26px;
+    }
+    input::placeholder{ 
+        color:#333; 
+    }
+    .layui-input {
+        width: 160px!important;
+    }
+    .layui-edge {
+        right: 202px!important;
+    }
+    .layui-form-select dl {
+        left: 3px!important;
+        top: 26px!important;
+        min-width: 45%!important;
+    }
+</style>
+<div class="page">
+    <div class="fixed-bar">
+        <div class="item-title">
+            <h3>公司信息管理</h3>
+            <ul class="tab-base">
+                <li><a href="index.php?act=refill_company&op=index"><span>公司信息管理</span></a></li>
+                <li><a href="index.php?act=refill_company&op=add"><span>新增</span></a></li>
+                <li><a href="index.php?act=refill_company&op=remit_cfg"><span>打款配置</span></a></li>
+                <li><a href="JavaScript:void(0);" class="current"><span>公司打款记录</span></a></li>
+            </ul>
+        </div>
+    </div>
+    <div class="fixed-empty"></div>
+    <form method="get" name="formSearch" id="formSearch" class="layui-form">
+        <input type="hidden" value="refill_company" name="act">
+        <input type="hidden" value="remit_record" name="op">
+        <input type="hidden" name="export" value=""/>
+        <table class="tb-type1 noborder search">
+            <tbody>
+            <tr>
+                <th><label for="query_start_time">记录时间</label></th>
+                <td>
+                    <input class="txt date" type="text" value="<?php echo $_GET['query_start_time']; ?>"
+                           id="startTime" name="query_start_time" autocomplete="off" style="width:130px" />
+                    <label for="query_start_time">~</label>
+                    <input class="txt date" type="text" value="<?php echo $_GET['query_end_time']; ?>"
+                           id="endTime" name="query_end_time" autocomplete="off" style="width:130px" />
+                </td>
+                <td>
+                    <a href="javascript:void(0);" id="ncsubmit" class="btn-search"
+                       title="<?php echo $lang['nc_query']; ?>">&nbsp;</a>
+                </td>
+            </tr>
+            </tbody>
+        </table>
+    </form>
+    <table class="table tb-type2" id="prompt">
+        <tbody>
+        </tbody>
+    </table>
+    <form method="post" id="merchant_name_form">
+        <input type="hidden" name="form_submit" value="ok"/>
+        <table class="table tb-type2">
+            <thead>
+            <tr class="thead">
+                <th>序号</th>
+                <th>记录ID</th>
+                <th>公司名称</th>
+                <th class="align-right">调整金额</th>
+                <th class="align-left">操作人</th>
+                <th class="align-left">操作日期</th>
+                <th class="align-center">操作</th>
+            </tr>
+            </thead>
+            <tbody>
+            <?php if (!empty($output['list']) && is_array($output['list'])) { ?>
+                <?php foreach ($output['list'] as $k => $v) { ?>
+                    <tr class="trFlex">
+                        <td><?php echo $k+1;?></td>
+                        <td><?php echo $v['remit_id']; ?></td>
+                        <td><?php echo $output['refill_company'][$v['co_id']]['co_name']; ?></td>
+                        <td class="align-right"><?php echo $v['amount']; ?></td>
+                        <td class="align-left"><?php echo $v['operation']; ?></td>
+                        <td class="align-left"><?php echo $v['add_time'] ? date('Y-m-d H:i', $v['add_time']) : $lang['no_limit']; ?></td>
+                        <td class="align-center">
+<!--                            <a href="index.php?act=provider&op=provider_amount_edit&amount_id=--><?php //echo $v['id'] ?><!--">编辑</a>-->
+                        </td>
+                    </tr>
+                <?php } ?>
+            <?php } else { ?>
+                <tr class="no_data">
+                    <td colspan="6"><?php echo $lang['nc_no_record']; ?></td>
+                </tr>
+            <?php } ?>
+            </tbody>
+            <tfoot>
+            <tr class="tfoot">
+
+                <td></td>
+                <td colspan="6">
+                    <div class="pagination"><?php echo $output['show_page']; ?></div>
+                </td>
+            </tr>
+            </tfoot>
+        </table>
+    </form>
+</div>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery.edit.js" charset="utf-8"></script>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/laydate/laydate.js"></script>
+<script type="text/javascript" src="<?php echo ADMIN_TEMPLATES_URL;?>/layui/layui.js"></script>
+<link rel="stylesheet" type="text/css" href="<?php echo ADMIN_TEMPLATES_URL; ?>/layui/css/layui.css"/>
+<script>
+    $(function () {
+        // 日期选择器
+        laydate.render({
+            elem: '#startTime',
+            type: 'datetime',
+            trigger: 'click'
+        });
+        laydate.render({
+            elem: '#endTime',
+            type: 'datetime',
+            trigger: 'click'
+        });
+        $('#ncsubmit').click(function () {
+            $('#formSearch').submit();
+        });
+        // 表格hover时背景
+        $('.trFlex').each(function () {
+            $(this).hover(function () {
+                $(this)[0].style.backgroundColor = '#cbe9f3'
+            },function() {
+                $(this)[0].style.backgroundColor = '#fff'
+            })
+        })
+
+        // 导出
+        $('#ncexport').click(function () {
+            $('input[name="export"]').val('1');
+            $('#formSearch').submit();
+            $('input[name="export"]').val('');
+            let ii = layer.load();
+            setTimeout(function(){
+                layer.close(ii);
+            }, 800);
+        })
+
+    });
+</script>

+ 3 - 24
admin/templates/default/remit.config.php

@@ -8,11 +8,13 @@
                 <li><a href="index.php?act=refill_company&op=index"><span>上游信息管理</span></a></li>
                 <li><a href="index.php?act=refill_company&op=add"><span>新增</span></a></li>
                 <li><a href="JavaScript:void(0);" class="current"><span>打款配置</span></a></li>
+                <li><a href="index.php?act=refill_company&op=remit_record"><span>公司打款记录</span></a></li>
             </ul>
         </div>
     </div>
     <div class="fixed-empty"></div>
     <form id="user_form" enctype="multipart/form-data" method="post">
+        <input type="hidden" name="form_submit" value="ok" />
         <table class="table tb-type2">
             <tbody>
             <tr class="noborder">
@@ -50,30 +52,7 @@
     $(function () {
         //按钮先执行验证再提交表单
         $("#submitBtn").click(function () {
-            if ($("#user_form").valid()) {
-                $("#user_form").submit();
-            }
-        });
-        $('#user_form').validate({
-            errorPlacement: function (error, element) {
-                error.appendTo(element.parent().parent().prev().find('td:first'));
-            },
-            rules: {
-                feed_minorder: {
-                    required: true,
-                },
-                lowest_ratio: {
-                    required: true,
-                },
-            },
-            messages: {
-                feed_minorder: {
-                    required: '不能为空',
-                },
-                lowest_ratio: {
-                    required: '不能为空',
-                }
-            }
+            $("#user_form").submit();
         });
     });
 </script>

+ 23 - 0
data/model/refill_company_remit.model.php

@@ -0,0 +1,23 @@
+<?php
+
+defined('InShopNC') or exit('Access Invalid!');
+
+class refill_company_remitModel extends Model
+{
+    public function __construct()
+    {
+        parent::__construct('refill_company_remit');
+    }
+
+    public function getRemitList($condition, $pagesize = '',$total = 0, $field = '*', $order = 'co_id asc', $limit = '', $master = false)
+    {
+        $list = $this->field($field)->where($condition)->page($pagesize,$total)->order($order)->limit($limit)->master($master)->select();
+        if (empty($list)) return [];
+        return $list;
+    }
+
+    public function addRemit($insert)
+    {
+        return $this->insert($insert);
+    }
+}