xieruidong 2 years ago
parent
commit
282c1e25e6

+ 1 - 0
application/admin/view/orders/index.html

@@ -38,6 +38,7 @@
                            data-operate-detail="{:$auth->check('orders/detail')}"
                            data-operate-tax="{:$auth->check('orders/tax')}"
                            data-operate-logistics="{:$auth->check('orders/logistics')}"
+                           data-operate-payed="{:$auth->check('orders/payed')}"
                            width="100%">
                     </table>
                 </div>

+ 2 - 4
application/common/model/Orders.php

@@ -74,10 +74,7 @@ class Orders extends Model
         //self::S_REFUND=>'退款退货',
     ];
 
-    /**
-     * @return string[]
-     */
-    public static function getStatus(): array
+    public static function getStatus()
     {
         return self::$status;
     }
@@ -176,6 +173,7 @@ class Orders extends Model
     #支付
     public function makePayInfo($pay_type){
         $user=$this->user;
+        $this['pay_type']=$pay_type;
         if($pay_type==self::PT_OFF){
             $this['continue_expire_time']=strtotime(date('Y-m-d 00:00:00'))+self::EXP_PAY_OFFLINE+86400-1;
             $this->save();

+ 15 - 0
public/assets/js/backend/orders.js

@@ -64,6 +64,21 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                                 },
                                 {
                                     name: 'edit',
+                                    text: __('已收款'),
+                                    title: __('已收款'),
+                                    classname: 'btn btn-xs btn-info btn-ajax',
+                                    icon: 'fa',
+                                    url: 'orders/payed',
+                                    success: function (data) {
+                                        $('.btn-refresh').trigger('click')
+                                    },
+                                    visible: function (row) {
+                                        //返回true时按钮显示,返回false隐藏
+                                        return row.status===0 && table.data('operate-payed') && row.pay_type===6
+                                    }
+                                },
+                                {
+                                    name: 'edit',
                                     text: __('订单详情'),
                                     title: __('订单详情'),
                                     classname: 'btn btn-xs btn-info btn-detail btn-dialog',