hrjy 2 lat temu
rodzic
commit
00431c9ab6

+ 1 - 1
app/admin/model/many/ManyOrder.php

@@ -51,7 +51,7 @@ class ManyOrder extends BaseModel
         if (trim($where['name']) != '')$model->where('u.uid|u.account|u.nickname' , 'like', '%'.$where['name'].'%');
         if (trim($where['data']) != '') $model = self::getModelTime($where, $model,  'a.create_time');
         if ($where['type']){
-            $data['price'] = ManyOrder::where('status', '=', 0)->sum('price');
+            $data['price'] = ManyOrder::where('status', '=', 0)->sum('frozen');
             return $data;
         }
         $data['count'] = $model->count();

+ 1 - 1
app/api/controller/many/ManyController.php

@@ -75,7 +75,7 @@ class ManyController
             ['id'],
             ['price']
         ]);
-        $many = Many::where('id', $data['id'])->find();
+        $many = Many::where('id', $data['id'])->lock(true)->find();
         $surplus = $this->surplus($data['id'], $request->uid(),1);
         $user = User::where('uid', $request->uid())->find();
         if (!$many) return app('json')->fail('场次不存在');

+ 1 - 1
app/models/many/Many.php

@@ -160,7 +160,7 @@ class Many extends BaseModel
             {
                 $item['add_time'] += 86400*2;
                 $item['end_time'] += 86400*2;
-                $item['money'] = round($item['number'] * 1.3, 2);
+                $item['money'] = round($item['money'] * 1.3, 2);
                 $item['number'] = 0;
                 $item['stage'] += 1;
                 $item['status'] = 1;