瀏覽代碼

provider add available_predeposit

xiaoyu 3 年之前
父節點
當前提交
750028c915
共有 2 個文件被更改,包括 20 次插入4 次删除
  1. 18 4
      admin/control/provider.php
  2. 2 0
      admin/templates/default/provider.index.php

+ 18 - 4
admin/control/provider.php

@@ -32,11 +32,25 @@ class providerControl extends SystemControl
             ->order('opened asc, name asc')
             ->order('opened asc, name asc')
             ->page(100)
             ->page(100)
             ->select();
             ->select();
-        foreach ($provider_list as $key => $provider) {
-            if (!empty($provider['start_period']) && !empty($provider['end_period'])) {
-                $provider_list[$key]['period'] = $provider['start_period'] . '~' . $provider['end_period'];
+        $account_ids = $members = [];
+        foreach ($provider_list as $provider) {
+            if(!empty($provider['account_id'])) {
+                $account_ids[$provider['provider_id']] = $provider['account_id'];
+            }
+        }
+        if(!empty($account_ids)) {
+            $member_id = implode(',', $account_ids);
+            $member_data = Model('member')->field('member_id,available_predeposit')->where(['member_id' => ['in',$member_id]])->select();
+            foreach ($member_data as $member) {
+                $members[$member_id] = $member['available_predeposit'];
+            }
+        }
+        foreach ($provider_list as $key => $value) {
+            $account_id = $value['account_id'];
+            if (!empty($members[$account_id]) && array_key_exists($account_id, $members)) {
+                $provider_list[$key]['available_predeposit'] = $members[$account_id];
             } else {
             } else {
-                $provider_list[$key]['period'] = '全时间段';
+                $provider_list[$key]['available_predeposit'] = 0;
             }
             }
         }
         }
         $opened_text = ['使用中', '已禁用'];
         $opened_text = ['使用中', '已禁用'];

+ 2 - 0
admin/templates/default/provider.index.php

@@ -83,6 +83,7 @@
                 <th>通道名称</th>
                 <th>通道名称</th>
                 <th>店铺ID</th>
                 <th>店铺ID</th>
                 <th>会员ID</th>
                 <th>会员ID</th>
+                <th>通道余额</th>
                 <th>通道类型</th>
                 <th>通道类型</th>
                 <th class="align-center">通道状态</th>
                 <th class="align-center">通道状态</th>
                 <th>余额</th>
                 <th>余额</th>
@@ -97,6 +98,7 @@
                         <td><?php echo $v['name']; ?> (<?php echo $v['store_name'];?>)</td>
                         <td><?php echo $v['name']; ?> (<?php echo $v['store_name'];?>)</td>
                         <td><?php echo $v['store_id']; ?></td>
                         <td><?php echo $v['store_id']; ?></td>
                         <td><?php echo $v['account_id']; ?></td>
                         <td><?php echo $v['account_id']; ?></td>
+                        <td><?php echo $v['available_predeposit']; ?></td>
                         <td><?php echo $output['type_text'][$v['type']-1]; ?></td>
                         <td><?php echo $output['type_text'][$v['type']-1]; ?></td>
 
 
                         <td class="align-center">
                         <td class="align-center">