Tree 2 månader sedan
förälder
incheckning
a94a21d1fd

+ 1 - 1
app/Http/Controllers/Admin/RechargeController.php

@@ -855,7 +855,7 @@ class RechargeController extends Controller
         if ($request->method() == 'POST') {
             $money = (float)$request->money ?: '';
             $status = $request->status;
-            $config_ids = $request->config_ids;
+//            $config_ids = $request->config_ids;
             $favorable_price = (float)$request->favorable_price;
             $give = (float)$request->give;
             $logic = new RechargeLogic();

+ 15 - 15
app/Http/logic/admin/RechargeLogic.php

@@ -247,25 +247,25 @@ class RechargeLogic extends BaseApiLogic
     public function add($money, $status, $config_ids, $favorable_price, $give)
     {
         // 查询所有渠道
-        $pluck = DB::table('agent.dbo.admin_configs')->where('type', 'pay')->pluck('id')->toArray();
+//        $pluck = DB::table('agent.dbo.admin_configs')->where('type', 'pay')->pluck('id')->toArray();
         $data = [];
-        foreach ($pluck as $val) {
-            if (in_array($val, $config_ids)) {
-                $data[] = [
-                    'id' => $val,
-                    'status' => 1
-                ];
-            } else {
-                $data[] = [
-                    'id' => $val,
-                    'status' => -1
-                ];
-            }
-        }
+//        foreach ($pluck as $val) {
+//            if (in_array($val, $config_ids)) {
+//                $data[] = [
+//                    'id' => $val,
+//                    'status' => 1
+//                ];
+//            } else {
+//                $data[] = [
+//                    'id' => $val,
+//                    'status' => -1
+//                ];
+//            }
+//        }
         $add_data = [
             'money' => round($money, 2),
             'status' => $status,
-            'gear' => \GuzzleHttp\json_encode($data),
+            //'gear' => \GuzzleHttp\json_encode($data),
             'created_at' => date('Y-m-d H:i:s'),
             'favorable_price' => round($favorable_price, 2),
             'give' => round($give, 2)

+ 5 - 14
resources/views/admin/recharge/add.blade.php

@@ -24,15 +24,6 @@
                                     <input type="number" step="0.01" class="form-control required" name="give" placeholder="{{ __('auto.请输入咖啡档位') }}" value="0">
                                 </div>
 
-                                <div class="form-group">
-                                    <label for="account">*渠道</label> <br>
-                                    @foreach($list as $key=>$val)
-                                        {{$val}}:<input type="checkbox"   name="config_id" value={{$key}}  @if ($loop->first)
-                                            checked
-                                        @endif>&nbsp;&nbsp;&nbsp;
-                                    @endforeach
-
-                                </div>
                                 <div class="form-group">
                                     <label for="account">*开关</label><br>
                                     {{ __('auto.开启') }} <input type="radio"   name="status" value="1" checked>&nbsp;&nbsp;
@@ -66,17 +57,17 @@
                 return false;
             }
 
-            var config_ids = []
-            $("input:checkbox:checked").each(function () {
-                config_ids.push($(this).val())
-            })
+            // var config_ids = []
+            // $("input:checkbox:checked").each(function () {
+            //     config_ids.push($(this).val())
+            // })
             var data = $("#form").serializeObject();
 
             var money = data.money
             var status = data.status
             var favorable_price = data.favorable_price
             var give = data.give
-            myRequest("/admin/recharge/add","post", {money,status,config_ids,favorable_price,give},function(res){
+            myRequest("/admin/recharge/add","post", {money,status,favorable_price,give},function(res){
                 if(res.code == '200'){
                     layer.msg(res.msg)
                     setTimeout(function(){