From 648b27a6a187c054118dbb0e94a9d089c5e8d209 Mon Sep 17 00:00:00 2001 From: lqmac Date: Sat, 28 Oct 2023 21:27:10 +0800 Subject: [PATCH] 1 --- application/admin/controller/Order.php | 1 + application/admin/controller/Warehouse.php | 4 ++-- application/admin/view/user/user/edit.html | 4 ++-- application/admin/view/warehouse/add.html | 4 ++-- application/admin/view/warehouse/edit.html | 4 ++-- application/api/controller/User.php | 6 +++--- application/common/service/OrderService.php | 4 ++-- public/assets/js/backend/income/expend.js | 1 + 8 files changed, 15 insertions(+), 13 deletions(-) diff --git a/application/admin/controller/Order.php b/application/admin/controller/Order.php index feb48f5..40bcb34 100755 --- a/application/admin/controller/Order.php +++ b/application/admin/controller/Order.php @@ -244,6 +244,7 @@ class Order extends Backend "warehouse_id" => $row->warehouse_id, "order_amount" => $value['price'], "pay_amount" => $value['price'], + "actual_amount" => $value['price'], "coupon_price" => 0, "coupon_id" => 0, "status" => 3, diff --git a/application/admin/controller/Warehouse.php b/application/admin/controller/Warehouse.php index efe4ba9..778e186 100755 --- a/application/admin/controller/Warehouse.php +++ b/application/admin/controller/Warehouse.php @@ -54,7 +54,7 @@ class Warehouse extends Backend if (time() > strtotime($v['end'])) { $v['show_status'] = 1; - $info = Expend::where('date', date("Y-m-d"))->find(); + $info = Expend::where('date', date("Y-m-d"))->where('is_delete', 0)->find(); if ($info) { if ($info['status'] == 0) { $v['show_status'] = 2; @@ -138,7 +138,7 @@ class Warehouse extends Backend if (!$row) $this->error(__('No Results were found')); if ($this->request->isPost()){ - $info = Expend::where('date', date("Y-m-d"))->find(); + $info = Expend::where('date', date("Y-m-d"))->where('is_delete', 0)->find(); if ($info) { $this->error(__('今日订单汇算已生成过了')); } diff --git a/application/admin/view/user/user/edit.html b/application/admin/view/user/user/edit.html index cb51b0b..b36ee6b 100755 --- a/application/admin/view/user/user/edit.html +++ b/application/admin/view/user/user/edit.html @@ -64,12 +64,12 @@ -
+
diff --git a/application/admin/view/warehouse/add.html b/application/admin/view/warehouse/add.html index ad53463..4ac4ea3 100755 --- a/application/admin/view/warehouse/add.html +++ b/application/admin/view/warehouse/add.html @@ -32,7 +32,7 @@
-
+
diff --git a/application/admin/view/warehouse/edit.html b/application/admin/view/warehouse/edit.html index 8c34808..defe051 100755 --- a/application/admin/view/warehouse/edit.html +++ b/application/admin/view/warehouse/edit.html @@ -32,7 +32,7 @@
-
+
diff --git a/application/api/controller/User.php b/application/api/controller/User.php index 6db902a..e4b355e 100755 --- a/application/api/controller/User.php +++ b/application/api/controller/User.php @@ -635,7 +635,7 @@ class User extends Api */ public function getUserIncomeAndExpandList(){ $user = $this->auth->getUserinfo(); - $list = Db::name('income_expend')->where(function ($query) use($user) { + $list = Db::name('income_expend')->where('is_delete', 0)->where(function ($query) use($user) { $query->where('payee_id', $user['id'])->whereor('payer_id', $user['id']); @@ -678,7 +678,7 @@ class User extends Api } Db::name('income_expend')->where("id", $id)->update(["pay_voucher" => $pay_voucher, "updatetime" => time(),'status' => 2]); //是否都提交了了支付凭证,更新我的买单为支付待确认,卖单为已完成 - $is_all = Db::name('income_expend')->whereTime('createtime', 'today')->where("payer_id", $user['id'])->where('pay_voucher', '')->find(); + $is_all = Db::name('income_expend')->where('is_delete', 0)->whereTime('createtime', 'today')->where("payer_id", $user['id'])->where('pay_voucher', '')->find(); // var_dump($is_all); // exit(); if (!$is_all) { @@ -715,7 +715,7 @@ class User extends Api } Db::name('income_expend')->where("id", $id)->update(['status' => 3, "updatetime" => time()]); //把今天自己的卖单订单都改为已完成,买单更新为已支付 - $is_all = Db::name('income_expend')->whereTime('createtime', 'today')->where("payee_id", $user['id'])->where('status','<>', 3)->find(); + $is_all = Db::name('income_expend')->where('is_delete', 0)->whereTime('createtime', 'today')->where("payee_id", $user['id'])->where('status','<>', 3)->find(); if (!$is_all) { Db::name('order') ->whereTime('createtime', 'today') diff --git a/application/common/service/OrderService.php b/application/common/service/OrderService.php index 6327afc..3db2daa 100755 --- a/application/common/service/OrderService.php +++ b/application/common/service/OrderService.php @@ -31,8 +31,8 @@ class OrderService ->field('user_id,actual_amount as pay_amount,sell_order_id') ->whereTime('createtime', 'today') ->where('warehouse_id', $warehouse_id) - ->whereIn('status', 0) - ->whereIn('order_type', 0) + ->whereIn('status', [0,1]) + ->whereIn('order_type', [0]) ->select(); if (!$buyer_order) { return false; diff --git a/public/assets/js/backend/income/expend.js b/public/assets/js/backend/income/expend.js index b3e3123..789343d 100755 --- a/public/assets/js/backend/income/expend.js +++ b/public/assets/js/backend/income/expend.js @@ -35,6 +35,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin {field: 'status', title: __('Status'),formatter: Table.api.formatter.status, searchList: Config.statusList}, {field: 'user.nickname', title: __('付款人'),operate: 'LIKE'}, {field: 'user.mobile', title: __('付款人电话'),operate: 'LIKE'}, + {field: 'is_delete', title: __('是否删除'),formatter: Table.api.formatter.status, searchList: {1: __('是'), 0: __('否')}}, {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} ]