wangxiaodong 3 years ago
parent
commit
adc7c9ce0a

+ 11 - 0
application/finance/controller/Order.php

@@ -108,6 +108,17 @@ class Order extends Controller
 
     }
 
+    /**
+     * 账单支付
+     * */
+    public function order_pay(){
+        $id = input('id/d',0);
+        $order_data['is_pay'] = 1;
+        $order_data['pay_time'] = date('Y-m-d H:i:s',time());
+        $is_pay = Db::table('hy_order')->where('id',$id)->update($order_data);
+        $is_order_card = Db::table('hy_order_card')->where('oid',$id)->update(['is_pay'=>1]);
+        $this->success('操作成功','','javascript:window.location.reload()');
+    }
 
 
 }

+ 4 - 0
application/finance/view/order/index.html

@@ -54,6 +54,10 @@
                 <a data-dbclick class="layui-btn layui-btn-sm" data-title="查看具体账单" data-open='{:url("cardorder/index")}?id={$vo.id}'>查看详情</a>
                 {/if}
 
+                {if auth("order_pay") && $vo.is_pay ==0}
+                <a class="layui-btn layui-btn-sm layui-btn-danger" data-confirm="确定该账单已支付吗?" data-action="{:url('order_pay')}" data-value="id#{$vo.id}" data-csrf="{:systoken('order_pay')}">已支付</a>
+                {/if}
+
                 {if auth("remove")}
                 <a class="layui-btn layui-btn-sm layui-btn-danger" data-confirm="确定要删除该账单吗?" data-action="{:url('remove')}" data-value="id#{$vo.id}" data-csrf="{:systoken('remove')}">删 除</a>
                 {/if}