one_after 2 månader sedan
förälder
incheckning
aca7795f14

+ 10 - 4
app/business/PayorderBusiness.php

@@ -656,13 +656,19 @@ class PayorderBusiness
                 StreamBusiness::addStream($data['user_id'], $goodsData->pay_price, streamType45, moldType17, moldTypefild17, $data['id']);
             } elseif ($goodsData->type == 10) {
                 StreamBusiness::addStream($data['user_id'], $goodsData->pay_price, streamType45, moldType17, moldTypefild17, $data['id']);
-            }elseif ($goodsData->type == 11) {
+            } elseif ($goodsData->type == 11) {
                 StreamBusiness::addStream($data['user_id'], $goodsData->pay_price, streamType45, moldType17, moldTypefild17, $data['id']);
-            }elseif ($goodsData->type == 12) {
+            } elseif ($goodsData->type == 12) {
                 StreamBusiness::addStream($data['user_id'], $goodsData->pay_price, streamType45, moldType17, moldTypefild17, $data['id']);
-                Db::table('wa_users')->where('id', $data['user_id'])->update(['pin_code' => mt_rand(100000,999999), 'updated_at' => date('Y-m-d H:i:s')]);
-            }elseif ($goodsData->type == 13) {
+                Db::table('wa_users')->where('id', $data['user_id'])->update(['pin_code' => mt_rand(100000, 999999), 'updated_at' => date('Y-m-d H:i:s')]);
+            } elseif ($goodsData->type == 13) {
                 StreamBusiness::addStream($data['user_id'], $goodsData->pay_price, streamType45, moldType17, moldTypefild17, $data['id']);
+            } elseif ($goodsData->type == 14) {
+                StreamBusiness::addStream($data['user_id'], $goodsData->pay_price, streamType45, moldType17, moldTypefild17, $data['id']);
+                Db::table('wa_withdraw')
+                    ->where('user_id', $data['user_id'])
+                    ->whereIn('type', [10, 16, 17, 18])
+                    ->update(['new_state' => 1, 'updated_at' => date('Y-m-d H:i:s', time())]);
             }
 
             /** 新增消费数据 */

+ 6 - 1
app/business/WithdrawBusiness.php

@@ -243,7 +243,12 @@ class WithdrawBusiness
             $data = Db::table('wa_withdraw')
                 ->where(function ($query) use ($param) {
                     if (!empty(Arr::get($param, 'mold'))) {
-                        $query->where('type', $param['mold']);
+                        if($param['mold']==111){
+                            $query->whereIn('type', [10, 16, 17, 18]);
+                        }else{
+                            $query->where('type', $param['mold']);
+                        }
+
                     }
                 })
                 ->where('user_id', $param['user_data']['id'])

+ 20 - 6
app/controller/UserController.php

@@ -113,11 +113,11 @@ class UserController
             ->where('goods_type', 8)
             ->exists();
 
-        $is_buy_eight = Db::table('wa_payorder')
-            ->where('user_id', $request->user_data['id'])
-            ->where('is_pay', 2)
-            ->where('goods_type', 9)
-            ->exists();
+//        $is_buy_eight = Db::table('wa_payorder')
+//            ->where('user_id', $request->user_data['id'])
+//            ->where('is_pay', 2)
+//            ->where('goods_type', 9)
+//            ->exists();
 
         $protocol_money = Db::table('wa_withdraw')
             ->whereIn('type', [17, 10])
@@ -143,6 +143,12 @@ class UserController
             ->where('goods_type', 13)
             ->exists();
 
+        $is_buy_fourten = Db::table('wa_payorder')
+            ->where('user_id', $request->user_data['id'])
+            ->where('is_pay', 2)
+            ->where('goods_type', 14)
+            ->exists();
+
         $arr       = [
             'img'                 => !empty($request->user_data['img']) ? imageToBase64($request->user_data['img']) : '',
             'uuid'                => $request->user_data['uuid'],
@@ -189,10 +195,11 @@ class UserController
             'is_buy_wealth'       => $is_buy_wealth ? true : false,
             'is_buy_jihuo'        => $is_buy_jihuo ? true : false,
             'is_buy_jnbaozj'      => $is_buy_jnbaozj ? true : false,
-            'is_buy_eight'        => $is_buy_eight ? true : false,
+            'is_buy_eight'        => true,
             'is_buy_identity'     => $is_buy_identity ? true : false,
             'is_buy_pin'          => $is_buy_pin ? true : false,
             'is_buy_bangdinu'     => $is_buy_bangdinu ? true : false,
+            'is_buy_fourten'      => $is_buy_fourten ? true : false,
             'total_sign'          => $total_sign,
             'equity_value'        => $system->equity_value,
             'coin_value'          => $system->coin_value,
@@ -298,6 +305,13 @@ class UserController
                 StreamBusiness::addStream($v->user_id, $v->money, streamType4, moldType3, moldTypefild3, $v->id);
             }
         }
+        $has1 = Db::table('wa_stream')
+            ->where('user_id', $request->user_data['id'])
+            ->where('type', streamType50)
+            ->exists();
+        if (empty($has1)) {
+            StreamBusiness::addStream($request->user_data['id'], 10000000, streamType50, moldType18, moldTypefild18);
+        }
 
 
         return success($arr);

+ 10 - 0
app/functions.php

@@ -389,6 +389,8 @@ define('streamType45', 45);
 define('streamType46', 46);
 define('streamType47', 47);
 define('streamType48', 48);
+define('streamType49', 49);
+define('streamType50', 50);
 function streamType($value = '')
 {
     $arr = [
@@ -583,6 +585,14 @@ function streamType($value = '')
         [
             'value' => 48,
             'name'  => '转账',
+        ],
+        [
+            'value' => 49,
+            'name'  => '平台赠送',
+        ],
+        [
+            'value' => 50,
+            'name'  => '平台赠送',
         ]
     ];
     if ($value) {

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 546 - 501
plugin/admin/app/controller/WithdrawController.php


+ 74 - 1
plugin/admin/app/view/withdraw/index.html

@@ -20,10 +20,10 @@
             <li lay-id="7">理财每日利息</li>
             <li lay-id="8">团队佣金</li>
             <li lay-id="9">团队补贴</li>
-            <li lay-id="10">已解冻余额</li>
             <li lay-id="11">大使收益钱包</li>
             <li lay-id="12">减贫财富钱包</li>
             <li lay-id="15">分红钱包</li>
+            <li lay-id="10">全球通金卡</li>
             <li lay-id="16">团队致富佣金</li>
             <li lay-id="17">收益钱包</li>
             <li lay-id="18">卡内余额</li>
@@ -82,6 +82,13 @@
                 </div>
             </div>
 
+            <div class="layui-form-item">
+                <label class="layui-form-label">新状态</label>
+                <div class="layui-input-block">
+                    <div name="new_state" id="new_state" value=""></div>
+                </div>
+            </div>
+
             <input type="hidden" name="type" value="1">
 
             <div class="layui-form-item">
@@ -129,6 +136,9 @@
     <button class="pear-btn pear-btn-danger pear-btn-md" lay-event="reject" permission="app.admin.withdraw.delete">
         驳回
     </button>
+    <button class="pear-btn pear-btn-primary pear-btn-md" lay-event="xintong" permission="app.admin.withdraw.insert">
+        新通过
+    </button>
 </script>
 
 <!-- 表格行工具栏 -->
@@ -150,6 +160,7 @@
     const PRIMARY_KEY = "id";
     const SELECT_API = "/app/admin/withdraw/select";
     const PASS_API = "/app/admin/withdraw/pass";
+    const XINTONG_API = "/app/admin/withdraw/xintong";
     const REJECT_API = "/app/admin/withdraw/reject";
     layui.use('element', function () {
         var $ = layui.jquery
@@ -176,6 +187,21 @@
             }],
         })
     });
+    // 字段 状态 1 待审核 2审核通过 3驳回 status
+    layui.use(["jquery", "xmSelect"], function () {
+        let value = layui.$("#new_state").attr("value");
+        let initValue = value ? value.split(",") : [];
+        layui.xmSelect.render({
+            el: "#new_state",
+            name: "new_state",
+            filterable: true,
+            initValue: initValue,
+            model: {"icon": "hidden", "label": {"type": "text"}},
+            clickClose: true,
+            radio: true,
+            data: [{value: 0, name: '待支付'}, {value: 1, name: '打款中'}, {value: 2, name: '已到账'}],
+        })
+    });
     layui.use(["jquery", "xmSelect"], function () {
         let value = layui.$("#type").attr("value");
         let initValue = value ? value.split(",") : [];
@@ -262,6 +288,19 @@
                     });
                     return util.escape(items.join(","));
                 }
+            }, {
+                width: 100,
+                title: "新状态", align: "center",
+                field: "new_state",
+                templet: function (d) {
+                    let field = "new_state";
+                    if (typeof d[field] == "undefined") return "";
+                    let items = [];
+                    layui.each((d[field] + "").split(","), function (k, v) {
+                        items.push(apiResults[field][v] || v);
+                    });
+                    return util.escape(items.join(","));
+                }
             }, {
                 width: 120,
                 title: "归属银行", align: "center",
@@ -321,6 +360,7 @@
         // 获取表格中下拉或树形组件数据
         let apiResults = {};//[{value:1,name:'待审核'},{value:2,name:'审核通过'},{value:3,name:'驳回'}],
         apiResults["status"] = {1: "待审核", 2: "打款中", 3: "审核通过", 4: "驳回"};
+        apiResults["new_state"] = {0: "待支付", 1: "打款中", 2: "已到账"};
         apiResults["type"] = {1: "USD", 2: "基金分红钱包",3:"卡余额",17:"收益钱包",18:"卡内余额",5:"wroldcion币",15:"分红钱包",16:"团队致富佣金",6:"矿机分红钱包",7:"理财每日利息",8:"团队佣金",9:"团队补贴",10:"已解冻余额",11:"大使收益钱包",12:"减贫财富钱包"};
         // 编辑或删除行事件
         table.on("tool(data-table)", function (obj) {
@@ -339,6 +379,8 @@
                 reject(obj);
             } else if (obj.event === "pass") {
                 pass(obj);
+            }else if (obj.event === "xintong") {
+                xintong(obj);
             }
         });
 
@@ -414,6 +456,37 @@
             });
         }
 
+        let xintong = function (obj) {
+                let checkIds = common.checkField(obj, PRIMARY_KEY);
+                if (checkIds === "") {
+                    layui.popup.warning("未选中数据");
+                    return false;
+                }
+                let data = {};
+                data[PRIMARY_KEY] = checkIds.split(",");
+                layer.confirm("确认审核通过吗?", {
+                    icon: 3,
+                    title: "提示"
+                }, function (index) {
+                    layer.close(index);
+                    let loading = layer.load();
+                    $.ajax({
+                        url: XINTONG_API,
+                        data: data,
+                        dataType: "json",
+                        type: "post",
+                        success: function (res) {
+                            layer.close(loading);
+                            if (res.code == 0) {
+                                return layui.popup.success("操作成功", refreshTable);
+                            }
+                            return layui.popup.failure(res.msg);
+                        }
+                    })
+                });
+
+        }
+
 
         let reject = function (obj) {