Browse Source

添加记录

afa 7 months ago
parent
commit
4889125e99

+ 1 - 1
application/admin/controller/product/Buying.php

@@ -39,7 +39,7 @@ class Buying extends Backend
         }
         [$where, $sort, $order, $offset, $limit] = $this->buildparams();
         $ids = $this->request->param('ids');
-        $list = $this->model->with('users')
+        $list = $this->model->with('users,productlists')
             ->where($where)
             //->where('synthesis_id', '=', $ids)
             ->order($sort, $order)

+ 0 - 1
application/api/controller/Market.php

@@ -169,7 +169,6 @@ class Market extends Api
             //关闭订单
             $productOrder::where('id', $params['order_id'])->where('user_id', $this->auth->id)->setField(['status' => ProductOrder::Closure]);
 
-
             if(($buying->stock - $buying->num) == 1) $buying->status = ProductBuying::SaleOut;
             $buying->num += 1;
             $buying->save();

+ 1 - 1
application/common/model/UserBuying.php

@@ -42,7 +42,7 @@ class UserBuying  extends Model
     ];
 
     //出售记录
-    public static function getCreateUserBuying(int $uid, int $orderId, int $buyingId, int $fromId, float $amount)
+    public static function getCreateUserBuying(int $uid, int $buyingId, int $orderId,  int $fromId, float $amount)
     {
         $fee = bcmul(config('market_transfer.serve_fee'), $amount, 2);
         $income = bcsub($amount, $fee, 2);

+ 3 - 3
public/assets/js/backend/product/buying.js

@@ -23,13 +23,13 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                     [
                         {checkbox: true},
                         {field: 'id', title: __('Id')},
-                        {field: 'user_id', title: __('User_id')},
-                        {field: 'product_id', title: __('Product_id')},
+                        //users,productlists'
+                        {field: 'users.address', title: __('User_id')},
+                        {field: 'productlists.zh_name', title: __('Product_id')},
                         {field: 'min_price', title: __('Min_price'), operate: false},
                         {field: 'stock', title: __('Stock')},
                         {field: 'num', title: __('Num'), operate: false},
                         {field: 'total_price', title: __('Total_price'), operate:false},
-                        {field: 'status', title: __('Status')},
                         {field: 'status', title: __('Status'), searchList: {0:__('关闭'),1 :__('正常'), 2:__('已出售')}, formatter: Table.api.formatter.status},
                         {field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
                         {field: 'operate', title: __('Operate'),

+ 0 - 3
public/assets/js/backend/user/buying.js

@@ -25,15 +25,12 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                         {field: 'id', title: __('Id')},
                         //users,formuser,productlists,orders
                         {field: 'users.address', title: __('User_id')},
-                        {field: 'buying_id', title: __('Buying_id')},
                         {field: 'order_id', title: __('Order_id')},
                         {field: 'fromuser.address', title: __('From_id')},
                         {field: 'amount', title: __('Amount'), operate:'BETWEEN'},
                         {field: 'fee', title: __('Fee'), operate:'BETWEEN'},
                         {field: 'income', title: __('Income'), operate:'BETWEEN'},
                         {field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
-                        {field: 'update_time', title: __('Update_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
-                        {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
                     ]
                 ]
             });