From f534328987afd4a75a51d2b33d8e773a8e068b4e Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Sat, 4 Jan 2025 10:00:09 +0800 Subject: [PATCH 1/4] =?UTF-8?q?refactor(warehouse):=20=E9=87=8D=E6=9E=84?= =?UTF-8?q?=E4=BB=93=E5=BA=93=E7=9B=B8=E5=85=B3=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 优化库存增减操作,使用单独的方法进行处理 - 添加 SqlChannelLog 函数用于记录日志 - 修改 IndexController 中的 aa 方法,用于处理签名验证 --- .../InventoryTransferLogic.php | 16 +- .../WarehouseProductLogic.php | 149 ++++++++---------- .../WarehouseProductReturnLogic.php | 8 +- .../WarehouseProductStoregeLogic.php | 1 + app/api/controller/IndexController.php | 59 ++++++- app/functions.php | 14 +- 6 files changed, 154 insertions(+), 93 deletions(-) diff --git a/app/admin/logic/inventory_transfer/InventoryTransferLogic.php b/app/admin/logic/inventory_transfer/InventoryTransferLogic.php index bae2f627b..39a61e468 100644 --- a/app/admin/logic/inventory_transfer/InventoryTransferLogic.php +++ b/app/admin/logic/inventory_transfer/InventoryTransferLogic.php @@ -82,14 +82,22 @@ class InventoryTransferLogic extends BaseLogic 'two_id' => $params['two_id'] ]); if($params['one_type']==1){ - StoreBranchProduct::where('product_id', $params['product_id'])->where('store_id', $params['one_id'])->dec('stock', $params['nums'])->update(); + $find=StoreBranchProduct::where('product_id', $params['product_id'])->where('store_id', $params['one_id'])->find(); + $find->save(['stock' =>bcsub( $find['stock'],$params['nums'],2)]); + SqlChannelLog('StoreBranchProduct', $find['id'], $params['nums'], -1, Request()->url()); } elseif ($params['one_type'] == 2) { - WarehouseProductStorege::where('product_id', $params['product_id'])->where('warehouse_id', $params['one_id'])->dec('nums', $params['nums'])->update(); + $find=WarehouseProductStorege::where('product_id', $params['product_id'])->where('warehouse_id', $params['one_id'])->find(); + $find->save(['nums' =>bcsub( $find['nums'],$params['nums'],2)]); + SqlChannelLog('WarehouseProductStorege', $find['id'], $params['nums'], -1, Request()->url()); } if($params['two_type']==1){ - StoreBranchProduct::where('product_id', $params['product_id'])->where('store_id', $params['two_id'])->inc('stock', $params['nums'])->update(); + $find=StoreBranchProduct::where('product_id', $params['product_id'])->where('store_id', $params['two_id'])->find(); + $find->save(['stock' =>bcadd( $find['stock'],$params['nums'],2)]); + SqlChannelLog('StoreBranchProduct', $find['id'], $params['nums'], 1, Request()->url()); } elseif ($params['two_type'] == 2) { - WarehouseProductStorege::where('product_id', $params['product_id'])->where('warehouse_id', $params['two_id'])->inc('nums', $params['nums'])->update(); + $find=WarehouseProductStorege::where('product_id', $params['product_id'])->where('warehouse_id', $params['two_id'])->find(); + $find->save(['nums' =>bcadd( $find['nums'],$params['nums'],2)]); + SqlChannelLog('WarehouseProductStorege', $find['id'], $params['nums'], 1, Request()->url()); } Db::commit(); return true; diff --git a/app/admin/logic/warehouse_product/WarehouseProductLogic.php b/app/admin/logic/warehouse_product/WarehouseProductLogic.php index 1a1962d6a..3fd3e1bdf 100644 --- a/app/admin/logic/warehouse_product/WarehouseProductLogic.php +++ b/app/admin/logic/warehouse_product/WarehouseProductLogic.php @@ -37,7 +37,6 @@ class WarehouseProductLogic extends BaseLogic { // Db::startTrans(); try { - $before_nums = 0; $after_nums = 0; if ($params['order_type'] != 6) { $storege = WarehouseProductStorege::where('warehouse_id', $params['warehouse_id'])->where('product_id', $params['product_id'])->find(); @@ -48,23 +47,24 @@ class WarehouseProductLogic extends BaseLogic if (!$storeProduct) { throw new BusinessException('商品不存在'); } - if($storeProduct['purchase']<=0){ - $total_price=0; - }else{ + if ($storeProduct['purchase'] <= 0) { + $total_price = 0; + } else { $total_price = bcmul($after_nums, $storeProduct['purchase'], 2); } WarehouseProductStorege::update(['nums' => $after_nums, 'total_price' => $total_price], ['id' => $storege['id']]); + SqlChannelLog('WarehouseProductStorege', $storege['id'], $after_nums, 1, Request()->url()); + } - $before_nums = $storege['nums']; } else { $after_nums = $params['nums']; $storeProduct = StoreProduct::where('id', $params['product_id'])->findOrEmpty(); if (!$storeProduct) { throw new BusinessException('商品不存在'); } - if($storeProduct['purchase']<=0){ - $total_price=0; - }else{ + if ($storeProduct['purchase'] <= 0) { + $total_price = 0; + } else { $total_price = bcmul($after_nums, $storeProduct['purchase'], 2); } $data = [ @@ -77,6 +77,8 @@ class WarehouseProductLogic extends BaseLogic $data['nums'] = -$params['nums']; } $storege = WarehouseProductStorege::create($data); + SqlChannelLog('WarehouseProductStorege', $storege['id'], -$params['nums'], 1, Request()->url()); + } } $batch_count = WarehouseProduct::where(['product_id' => $params['product_id'], 'warehouse_id' => $params['warehouse_id'], 'financial_pm' => $params['financial_pm'], 'store_id' => $params['store_id']])->count(); @@ -89,8 +91,8 @@ class WarehouseProductLogic extends BaseLogic 'financial_pm' => $params['financial_pm'], 'batch' => $batch_count + 1, 'nums' => $params['nums'], - 'before_nums' => $before_nums, - 'after_nums' => $after_nums, + 'before_nums' => 0, + 'after_nums' => 0, 'price' => $params['price'] ?? '', 'purchase' => $params['purchase'] ?? '', // 'cost' => $params['cost'] ?? '', @@ -108,6 +110,8 @@ class WarehouseProductLogic extends BaseLogic $data['expiration_date'] = strtotime($params['expiration_date']); } $res = WarehouseProduct::create($data); + SqlChannelLog('WarehouseProduct', $res['id'], $params['nums'], $params['financial_pm'] == 1 ? 1 : -1, Request()->url()); + return $res; } catch (\Throwable $e) { throw new BusinessException($e->getMessage()); @@ -125,7 +129,7 @@ class WarehouseProductLogic extends BaseLogic if ($params['order_type'] != 6) { $storege = WarehouseProductStorege::where('warehouse_id', $params['warehouse_id'])->where('product_id', $params['product_id'])->find(); if ($storege) { - if(in_array($params['order_type'],[1,4])){ + if (in_array($params['order_type'], [1, 4])) { SystemStoreStorage::create([ 'store_id' => $params['store_id'], 'admin_id' => $params['admin_id'], @@ -140,6 +144,7 @@ class WarehouseProductLogic extends BaseLogic $after_nums = bcsub($storege['nums'], $params['nums']); $total_price = bcmul($after_nums, $params['purchase'], 2); WarehouseProductStorege::update(['nums' => bcsub($storege['nums'], $params['nums']), 'total_price' => $total_price], ['id' => $storege['id']]); + SqlChannelLog('WarehouseProductStorege', $storege['id'], bcsub($storege['nums'], $params['nums']), -1, Request()->url()); } else { $data = [ 'warehouse_id' => $params['warehouse_id'], @@ -148,6 +153,7 @@ class WarehouseProductLogic extends BaseLogic 'total_price' => 0 ]; $storege = WarehouseProductStorege::create($data); + SqlChannelLog('WarehouseProductStorege', $storege->id, -$params['nums'], -1, Request()->url()); } } else { $storege['nums'] = 0; @@ -176,6 +182,8 @@ class WarehouseProductLogic extends BaseLogic 'mark' => $params['mark'] ?? '', ]; $res = WarehouseProduct::create($data); + SqlChannelLog('WarehouseProduct', $res->id, $params['nums'], $params['financial_pm'] == 1 ? 1 : -1, Request()->url()); + Db::commit(); return $res; } catch (\Throwable $e) { @@ -195,42 +203,20 @@ class WarehouseProductLogic extends BaseLogic { Db::startTrans(); try { - $before_nums = 0; - $after_nums = 0; $find = WarehouseOrder::where('id', $params['oid'])->find(); if ($find) { $res = WarehouseProduct::where('id', $params['id'])->find(); - - if ($find['financial_pm'] == 1) { - WarehouseProductStorege::where('warehouse_id', $res['warehouse_id'])->where('product_id', $res['product_id'])->dec('nums', $res['nums'])->update(); - StoreBranchProduct::where('store_id', $res['store_id'])->where('product_id', $res['product_id'])->dec('stock', $res['nums'])->update(); - - $warehouseProductStorege = WarehouseProductStorege::where('warehouse_id', $res['warehouse_id'])->where('product_id', $res['product_id'])->find(); - WarehouseProductStorege::where('warehouse_id', $res['warehouse_id'])->where('product_id', $res['product_id'])->inc('nums', $params['nums'])->update(); - StoreBranchProduct::where('store_id', $res['store_id'])->where('product_id', $res['product_id'])->inc('stock', $params['nums'])->update(); - $before_nums = $warehouseProductStorege['nums']; - $after_nums = $warehouseProductStorege['nums'] + $params['nums']; - } else { - WarehouseProductStorege::where('warehouse_id', $res['warehouse_id'])->where('product_id', $res['product_id'])->inc('nums', $res['nums'])->update(); - StoreBranchProduct::where('store_id', $res['store_id'])->where('product_id', $res['product_id'])->dec('stock', $res['nums'])->update(); - - $warehouseProductStorege = WarehouseProductStorege::where('warehouse_id', $res['warehouse_id'])->where('product_id', $res['product_id'])->find(); - WarehouseProductStorege::where('warehouse_id', $res['warehouse_id'])->where('product_id', $res['product_id'])->dec('nums', $params['nums'])->update(); - StoreBranchProduct::where('store_id', $res['store_id'])->where('product_id', $res['product_id'])->inc('stock', $params['nums'])->update(); - $before_nums = $warehouseProductStorege['nums']; - $after_nums = bcsub($warehouseProductStorege['nums'], $params['nums'], 2); - } + self::decStock($res); + self::incStock($res, $params); $datas = [ 'nums' => $params['nums'], - 'before_nums' => $before_nums, - 'after_nums' => $after_nums, 'total_price' => $params['total_price'], ]; - if($find['financial_pm']==1){ + if ($find['financial_pm'] == 1) { $datas['supplier_id'] = $params['supplier_id']; $datas['pay_type'] = $params['pay_type']; $datas['purchase'] = $params['purchase']; - }else{ + } else { $datas['price'] = $params['price']; } if (isset($params['manufacture']) && $params['manufacture'] != '') { @@ -239,7 +225,7 @@ class WarehouseProductLogic extends BaseLogic if (isset($params['expiration_date']) && $params['expiration_date'] != '') { $datas['expiration_date'] = strtotime($params['expiration_date']); } - WarehouseProduct::where('id', $params['id'])->update($datas); + $res->save($datas); $finds = WarehouseProduct::where('oid', $params['oid'])->field('sum(nums) as nums,sum(total_price) as total_price')->find(); if ($finds) { WarehouseOrder::where('id', $params['oid'])->update([ @@ -269,14 +255,11 @@ class WarehouseProductLogic extends BaseLogic if ($res) { $res->delete(); if ($res['financial_pm'] == 1) { - WarehouseProductStorege::where('warehouse_id', $res['warehouse_id'])->where('product_id', $res['product_id'])->dec('nums', $res['nums'])->update(); + $find = WarehouseProductStorege::where('warehouse_id', $res['warehouse_id'])->where('product_id', $res['product_id'])->dec('nums', $res['nums'])->save(); + SqlChannelLog('WarehouseProductStorege', $find['id'], $res['nums'], -1, Request()->url()); } elseif ($res['financial_pm'] == 0) { - $stock = StoreBranchProduct::where(['store_id' => $res['store_id'], 'product_id' => $res['product_id']])->value('stock'); - if ($stock < $res['nums']) { - throw new BusinessException('商品库存不足,无法退回'); - } - StoreBranchProduct::where(['store_id' => $res['store_id'], 'product_id' => $res['product_id']])->dec('stock', $res['nums'])->update(); - WarehouseProductStorege::where('warehouse_id', $res['warehouse_id'])->where('product_id', $res['product_id'])->inc('nums', $res['nums'])->update(); + $find = WarehouseProductStorege::where('warehouse_id', $res['warehouse_id'])->where('product_id', $res['product_id'])->inc('nums', $res['nums'])->save(); + SqlChannelLog('WarehouseProductStorege', $find['id'], $res['nums'], 1, Request()->url()); } $find = WarehouseProduct::where('oid', $res['oid'])->field('sum(nums) as nums,sum(total_price) as total_price')->find(); if ($find) { @@ -321,44 +304,15 @@ class WarehouseProductLogic extends BaseLogic { Db::startTrans(); try { - $res = WarehouseProduct::where('id',$params['id'])->find(); + $res = WarehouseProduct::where('id', $params['id'])->find(); if ($res) { - if ($res['financial_pm'] == 1) { - WarehouseProductStorege::where('warehouse_id', $res['warehouse_id'])->where('product_id', $res['product_id'])->dec('nums', $res['nums'])->update(); - StoreBranchProduct::where('store_id', $res['store_id'])->where('product_id', $res['product_id'])->dec('stock', $res['nums'])->update(); - - $warehouseProductStorege = WarehouseProductStorege::where('warehouse_id', $res['warehouse_id'])->where('product_id', $res['product_id'])->find(); - WarehouseProductStorege::where('warehouse_id', $res['warehouse_id'])->where('product_id', $res['product_id'])->inc('nums', $params['nums'])->update(); - StoreBranchProduct::where('store_id', $res['store_id'])->where('product_id', $res['product_id'])->inc('stock', $params['nums'])->update(); - $before_nums = $warehouseProductStorege['nums']; - $after_nums = $warehouseProductStorege['nums'] + $params['nums']; - } else { - WarehouseProductStorege::where('warehouse_id', $res['warehouse_id'])->where('product_id', $res['product_id'])->inc('nums', $res['nums'])->update(); - StoreBranchProduct::where('store_id', $res['store_id'])->where('product_id', $res['product_id'])->dec('stock', $res['nums'])->update(); - - $warehouseProductStorege = WarehouseProductStorege::where('warehouse_id', $res['warehouse_id'])->where('product_id', $res['product_id'])->find(); - WarehouseProductStorege::where('warehouse_id', $res['warehouse_id'])->where('product_id', $res['product_id'])->dec('nums', $params['nums'])->update(); - StoreBranchProduct::where('store_id', $res['store_id'])->where('product_id', $res['product_id'])->inc('stock', $params['nums'])->update(); - $before_nums = $warehouseProductStorege['nums']; - $after_nums = bcsub($warehouseProductStorege['nums'], $params['nums'], 2); - } - if($res['financial_pm']==1){ - $datas=[ - 'nums' => $params['nums'], - 'before_nums' => $before_nums, - 'after_nums' => $after_nums, - 'total_price' => bcmul($params['nums'], $res['purchase'], 2), - - ]; - }else{ - $datas=[ - 'nums' => $params['nums'], - 'before_nums' => $before_nums, - 'after_nums' => $after_nums, - 'total_price' => bcmul($params['nums'], $res['price'], 2), - ]; - } - WarehouseProduct::where('id', $params['id'])->update($datas); + self::decStock($res); + self::incStock($res, $params); + $datas = [ + 'nums' => $params['nums'], + 'total_price' => bcmul($params['nums'], $res['price'], 2), + ]; + $res->save($datas); $finds = WarehouseProduct::where('oid', $res['oid'])->field('sum(nums) as nums')->find(); if ($finds) { WarehouseOrder::where('id', $res['oid'])->update([ @@ -388,4 +342,35 @@ class WarehouseProductLogic extends BaseLogic } return $data; } + + //减少 + private static function decStock($res) + { + $res = WarehouseProductStorege::where('warehouse_id', $res['warehouse_id']) + ->where('product_id', $res['product_id']) + ->dec('nums', $res['nums']) + ->save(); + SqlChannelLog('WarehouseProductStorege', $res['id'], $res['nums'], -1, Request()->url()); + + $res2 = StoreBranchProduct::where('id', $res['id']) + ->dec('stock', $res['nums']) + ->update(); + SqlChannelLog('StoreBranchProduct', $res2['id'], $res['nums'], -1, Request()->url()); + } + + //增加 + private static function incStock($res, $params) + { + $res = WarehouseProductStorege::where('warehouse_id', $res['warehouse_id']) + ->where('product_id', $res['product_id']) + ->inc('nums', $params['nums']) + ->save(); + SqlChannelLog('WarehouseProductStorege', $res['id'], $res['nums'], 1, Request()->url()); + + + $res2 = StoreBranchProduct::where('id', $res['id']) + ->inc('stock', $params['nums']) + ->save(); + SqlChannelLog('StoreBranchProduct', $res2['id'], $res['nums'], 1, Request()->url()); + } } diff --git a/app/admin/logic/warehouse_product_return/WarehouseProductReturnLogic.php b/app/admin/logic/warehouse_product_return/WarehouseProductReturnLogic.php index a2594842a..f1567fc63 100644 --- a/app/admin/logic/warehouse_product_return/WarehouseProductReturnLogic.php +++ b/app/admin/logic/warehouse_product_return/WarehouseProductReturnLogic.php @@ -114,9 +114,13 @@ class WarehouseProductReturnLogic extends BaseLogic WarehouseOrder::where(['id' => $find['oid']])->update(['total_price' => $total_price]); BeforehandOrder::update(['pay_price' => $total_price], ['id' => $params['bhoid']]); } - WarehouseProductStorege::where(['product_id' => $find['product_id'], 'warehouse_id' => $find['warehouse_id']])->inc('nums', $params['nums'])->update(); + $res=WarehouseProductStorege::where(['product_id' => $find['product_id'], 'warehouse_id' => $find['warehouse_id']])->find(); + $res->save(['nums' =>bcadd( $res['nums'],$params['nums'],2)]); + SqlChannelLog('WarehouseProductStorege', $res['id'], $params['nums'], 1, Request()->url()); } elseif ($params['financial_pm'] == 0 && $params['return_type'] == 2) { - WarehouseProductStorege::where(['product_id' => $find['product_id'], 'warehouse_id' => $find['warehouse_id']])->dec('nums', $params['nums'])->update(); + $res=WarehouseProductStorege::where(['product_id' => $find['product_id'], 'warehouse_id' => $find['warehouse_id']])->find(); + $res->save(['nums' =>bcsub( $res['nums'],$params['nums'],2)]); + SqlChannelLog('WarehouseProductStorege', $res['id'], $params['nums'], -1, Request()->url()); } } diff --git a/app/admin/logic/warehouse_product_storege/WarehouseProductStoregeLogic.php b/app/admin/logic/warehouse_product_storege/WarehouseProductStoregeLogic.php index f993e40f0..35e21387d 100644 --- a/app/admin/logic/warehouse_product_storege/WarehouseProductStoregeLogic.php +++ b/app/admin/logic/warehouse_product_storege/WarehouseProductStoregeLogic.php @@ -44,6 +44,7 @@ class WarehouseProductStoregeLogic extends BaseLogic $find=WarehouseProductStorege::where('id',$params['id'])->find(); if($find){ $find->save(['nums'=>$params['nums']]); + SqlChannelLog('WarehouseProductStorege', $params['id'], $params['nums'], 0,Request()->url()); } Db::commit(); return true; diff --git a/app/api/controller/IndexController.php b/app/api/controller/IndexController.php index 86b30def6..c12772889 100644 --- a/app/api/controller/IndexController.php +++ b/app/api/controller/IndexController.php @@ -11,6 +11,7 @@ use app\admin\logic\tools\GeneratorLogic; use app\api\lists\purchase_product_offer\PurchaseProductOfferListsTwo; use app\api\logic\order\OrderLogic as OrderOrderLogic; use app\common\cache\ExportCache; +use app\common\logic\ChangeLogLogic; use app\common\logic\PayNotifyLogic; use app\common\logic\store_order\StoreOrderLogic; use app\common\model\beforehand_order_record\BeforehandOrderRecord; @@ -50,14 +51,15 @@ use PhpOffice\PhpWord\Settings; use PhpOffice\PhpWord\IOFactory; use PhpOffice\PhpWord\Shared\Converter; use PhpOffice\PhpWord\Style\Font; +use Chance\Log\facades\OperationLog; class IndexController extends BaseApiController { - public $notNeedLogin = ['index', 'app_update', 'express_list', 'province', 'city', 'area', 'street', 'village', 'brigade', 'config', 'push', 'purchase_product_offer']; + public $notNeedLogin = ['aa','index', 'app_update', 'express_list', 'province', 'city', 'area', 'street', 'village', 'brigade', 'config', 'push', 'purchase_product_offer']; public function index() { - d(1); + d(1); $arr = Db::name('ceshi_copy')->select(); foreach ($arr as $k => $v) { $data = [ @@ -301,8 +303,8 @@ class IndexController extends BaseApiController if ($find) { Db::name('wps_product')->where('id', $find['id'])->update($arr); } else { - $arr['product_id']=$data['product_id']; - $arr['name']=$data['name']; + $arr['product_id'] = $data['product_id']; + $arr['name'] = $data['name']; Db::name('wps_product')->insert($arr); } } @@ -310,4 +312,53 @@ class IndexController extends BaseApiController return $this->fail('时间不能为空'); } } + + public function aa(){ + $boyd = $this->request->post(); + // 计算body的MD5值 + $microtime = microtime(true); + +// 将秒和微秒数转换为毫秒级时间戳 +$millisecondTimestamp = number_format($microtime * 1000, 0, '', ''); +// 输出结果 + $time = $millisecondTimestamp; + + // 需要签名的数据 + $data = [ + 'appid' => 'e328e0d083784b8cbbd8a45e2a13b430', + 'timestamp' => $time, + 'version' => "1.0.0" + ]; + $md5='{}'; + if($boyd){ + $md5 = md5(json_encode($boyd,true)); + $data['md5']=$md5; + }else{ + $md5 = md5($md5); + $data['md5']=$md5; + } + // 获取token + $token=$this->request->header('token'); + if($token){ + $data['token']=$token; + } + // 按字母顺序排序 + ksort($data); + + // 转换为JSON字符串 + $jsonString = json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); + // RSA私钥 + $privateKey = "MIICdQIBADANBgkqhkiG9w0BAQEFAASCAl8wggJbAgEAAoGBAKYtaukWByNHG8VZsvfIwEeJUKa0t2RaNNMp/IlgWj/29aK+nCZZC+zROc8xjQAAHKbQgwXeFzizzDb98Q8Qavgo+8zuNi2V45sj12+7yC1tfX4zRkm4Yqri+YifJLNXxoh46dvx9CsNrKT/e5we6irxaWJoXxGxeZ4pA1JpcrwHAgMBAAECgYBnoELe/yGMWjdzJbB42/MrqPFmQ6NpLOdsFu6oLDGbWcFrrzlooHbTQtWt4tRuf6NeUwChlBEfBt/+GvVL040gF2T2ylsMi3biktZDSlT/+DI7H5S1x4aBplIBc4yAp/vrFTyWmxdULEksap2BUf5fEqG/CVcWMI2zszORQi4QAQJBAO4z9FsOyPZ0ycrCFmQD9AYPzmnBvgTg/uU0xGY7yus8zIt29TL1uE77/ksmGxJQXXcRUt2ytPVm9YqXnXS/EgcCQQCyl9l7Kdr/eifOcRd9wAAXwsHKkjfJR1Vd1igv5wCZqSkXK2qxxvQDPE98HugosNkFxuyedFbfrbSQpPUjnIYBAkAyDXK8K4go2XOJim0ACSCeoXWjHVXbWpfU+9iFDu1drsHgUFfHpIBdAHB3xAMOPxrUqSw7b5C8vCy+OYuZe4jDAkAdpsqMAWID4sMzKmGtFjCtwT8to+MxPu+0ebcIZQEbghN5blLzm0WuN9g2kmcXQm114RYuJMC7uHpvPYQZ2oYBAkBBzytKuG5EhbsI5flwxYGTDvQtY1TGvsYVrt0anirPa9xVq+RYC2Jr9zk0j8s13QhXoVwAO6seO7cYN9n8J65t"; + + // 解码私钥 + $privateKeyPem = "-----BEGIN PRIVATE KEY-----\n" . wordwrap($privateKey, 64, "\n", true) . "\n-----END PRIVATE KEY-----"; + // 获取私钥资源 + $privateKeyResource = openssl_pkey_get_private($privateKeyPem); + openssl_sign($jsonString, $signature, $privateKeyResource, OPENSSL_ALGO_SHA1); + + // 将签名进行Base64编码 + $signatureString = base64_encode($signature); + + d($md5,$time,$signatureString); + } } diff --git a/app/functions.php b/app/functions.php index 2548a2290..a1ba54d9a 100644 --- a/app/functions.php +++ b/app/functions.php @@ -4,6 +4,7 @@ * Here is your custom functions. */ +use app\common\logic\ChangeLogLogic; use app\common\service\FileService; use support\Log; @@ -546,7 +547,18 @@ function channelLog($data, $type, $title = '更新前') $log = Log::channel($type); $log->info($title, $data); } - +/** + * 日志记录 + * @param model 模型 + * @param id 更新的模型组件id + * @param nums 更新的数量 + * @param pm 1:增加 -1:减少 + * @param url 请求地址 + */ +function SqlChannelLog($model='', $id=0, $nums=0,$pm=0,$url=''):void +{ + (new ChangeLogLogic())->insert($model, $id, $nums, $pm, $url); +} // if (!function_exists('getNewOrderSn')) { // /** From acac4d2950cca62e9ae0451167b785362b1adfb2 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Sat, 4 Jan 2025 10:20:35 +0800 Subject: [PATCH 2/4] =?UTF-8?q?refactor(admin):=20=E5=85=B3=E9=97=AD?= =?UTF-8?q?=E9=97=A8=E5=BA=97=E5=95=86=E5=93=81=E5=AF=BC=E5=85=A5=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=B9=B6=E4=BC=98=E5=8C=96=E5=BA=93=E5=AD=98=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 关闭了 StoreProductController 中的 import 方法,返回接口已关闭的错误信息 - 在 WarehouseLogic、StoreBranchProductLogic 和 SystemStoreStorageLogic 中添加了库存变动日志记录 - 使用 SqlChannelLog 函数记录 StoreProduct、StoreBranchProduct 和 WarehouseProductStorege 表的库存变动 --- .../store_product/StoreProductController.php | 78 -- app/admin/logic/statistic/WarehouseLogic.php | 3 + .../StoreBranchProductLogic.php | 2 + .../SystemStoreStorageLogic.php | 3 + app/common/logic/DemoPayNotifyLogic.php | 850 ------------------ app/common/logic/PayNotifyLogic.php | 4 + .../logic/store_order/StoreOrderLogic.php | 1 + 7 files changed, 13 insertions(+), 928 deletions(-) delete mode 100644 app/common/logic/DemoPayNotifyLogic.php diff --git a/app/admin/controller/store_product/StoreProductController.php b/app/admin/controller/store_product/StoreProductController.php index f2dbbe0fc..11e4810d8 100644 --- a/app/admin/controller/store_product/StoreProductController.php +++ b/app/admin/controller/store_product/StoreProductController.php @@ -130,83 +130,5 @@ class StoreProductController extends BaseAdminController public function import() { return $this->fail('接口已关闭'); - $product_arr = $this->request->post('product_arr'); - $store_arr = $this->request->post('store_arr'); - $stock_type = $this->request->post('stock_type', 1); - $warehouse_id = $this->request->post('warehouse_id'); - $count = count($store_arr); - foreach ($product_arr as $key => $arr) { - $stock = bcmul($arr['stock'], $count); - $nums = WarehouseProductStorege::where('warehouse_id', $warehouse_id)->where('product_id', $arr['id'])->value('nums'); - if ($nums < $stock) { - return $this->fail('商品库存不足'); - } - } - if ($count == 1) { - $store_id = $store_arr[0]; - foreach ($product_arr as $key => $arr) { - $data = [ - 'warehouse_id' => $warehouse_id, - 'product_id' => $arr['id'], - 'store_id' => $store_id, - 'financial_pm' => 0, - 'batch' => 1, - 'nums' => $arr['stock'], - 'status' => 1, - 'admin_id' => $this->adminId, - ]; - if ($arr['stock'] == 0) { - $find = StoreProduct::where('id', $arr['id'])->findOrEmpty()->toArray(); - StoreProductLogic::ordinary($arr, $store_id, $this->adminId, $find, $warehouse_id); - } else { - WarehouseProductLogic::add($data); - $find = StoreBranchProduct::where('product_id', $arr['id'])->where('store_id', $store_id)->find(); - if ($find) { - StoreBranchProduct::where('id', $find['id'])->inc('stock', $arr['stock'])->update(); - } else { - $find = StoreProduct::where('id', $arr['id'])->findOrEmpty()->toArray(); - StoreProductLogic::ordinary($arr, $store_id, $this->adminId, $find, $warehouse_id); - StoreBranchProduct::where('product_id', $arr['id'])->where('store_id', $store_id)->inc('stock', $arr['stock'])->update(); - } - } - // StoreProductLogic::ordinary($arr, $store_id, $this->adminId, $find, $warehouse_id); - - // Redis::send('store-storage', ['product_arr' => $arr, 'store_id' => $store_id, 'stock_type' => $stock_type, 'admin_id' => $this->adminId, 'warehouse_id' => $warehouse_id]); - } - } else { - foreach ($product_arr as $key => $arr) { - foreach ($store_arr as $k => $store_id) { - $data = [ - 'warehouse_id' => $warehouse_id, - 'product_id' => $arr['id'], - 'store_id' => $store_id, - 'financial_pm' => 0, - 'batch' => 1, - 'nums' => $arr['stock'], - 'status' => 1, - 'admin_id' => $this->adminId, - ]; - if ($arr['stock'] == 0) { - $find = StoreProduct::where('id', $arr['id'])->findOrEmpty()->toArray(); - StoreProductLogic::ordinary($arr, $store_id, $this->adminId, $find, $warehouse_id); - } else { - WarehouseProductLogic::add($data); - $find = StoreBranchProduct::where('product_id', $arr['id'])->where('store_id', $store_id)->find(); - if ($find) { - StoreBranchProduct::where('id', $find['id'])->inc('stock', $arr['stock'])->update(); - } else { - StoreProductLogic::ordinary($arr, $store_id, $this->adminId, $find, $warehouse_id); - StoreBranchProduct::where('product_id', $arr['id'])->where('store_id', $store_id)->inc('stock', $arr['stock'])->update(); - } - } - - // $find = StoreProduct::where('id', $arr['id'])->findOrEmpty()->toArray(); - // StoreProductLogic::ordinary($arr, $store_id, $this->adminId, $find, $warehouse_id); - // Redis::send('store-storage', ['product_arr' => $arr, 'store_id' => $store_id, 'stock_type' => $stock_type, 'admin_id' => $this->adminId, 'warehouse_id' => $warehouse_id]); - } - } - } - return $this->success('已导入后台队列,请在门店入库记录中查看', [], 1, 1); - } } diff --git a/app/admin/logic/statistic/WarehouseLogic.php b/app/admin/logic/statistic/WarehouseLogic.php index d0fab7414..191c5d51b 100644 --- a/app/admin/logic/statistic/WarehouseLogic.php +++ b/app/admin/logic/statistic/WarehouseLogic.php @@ -271,10 +271,13 @@ class WarehouseLogic extends BaseLogic { if ($parmas['type'] == 1) { $res = StoreProduct::where('id', $parmas['id'])->update(['stock' => 0]); + SqlChannelLog('StoreProduct', $parmas['id'], 0, 0, Request()->url()); } elseif ($parmas['type'] == 2) { $res = StoreBranchProduct::where('id', $parmas['id'])->update(['stock' => 0]); + SqlChannelLog('StoreBranchProduct', $parmas['id'], 0, 0, Request()->url()); } elseif ($parmas['type'] == 3) { $res = WarehouseProductStorege::where('id', $parmas['id'])->update(['nums' => 0]); + SqlChannelLog('WarehouseProductStorege', $parmas['id'], 0, 0, Request()->url()); } return $res; } diff --git a/app/admin/logic/store_branch_product/StoreBranchProductLogic.php b/app/admin/logic/store_branch_product/StoreBranchProductLogic.php index d3bf75c31..e1394f7ab 100644 --- a/app/admin/logic/store_branch_product/StoreBranchProductLogic.php +++ b/app/admin/logic/store_branch_product/StoreBranchProductLogic.php @@ -88,6 +88,7 @@ class StoreBranchProductLogic extends BaseLogic $branchStock = bcadd($storeBranchProduct['stock'], $params['nums'], 2); StoreBranchProduct::update(['stock' => $branchStock, 'total_price' => bcmul($branchStock, $find['purchase'], 2)],['id'=> $params['id']]); + SqlChannelLog('StoreBranchProduct', $params['id'], $params['nums'], 1, Request()->url()); StoreProduct::update(['stock' => $stock, 'total_price' => bcmul($stock, $find['purchase'], 2)],['id'=> $params['product_id']]); } else { @@ -95,6 +96,7 @@ class StoreBranchProductLogic extends BaseLogic $stock = bcsub($find['stock'], $params['nums'], 2); StoreBranchProduct::where('id', $params['id'])->update(['stock' => $branchStock, 'total_price' => bcmul($branchStock, $find['purchase'], 2)],['id'=>$params['id']]); + SqlChannelLog('StoreBranchProduct', $params['id'], $params['nums'], -1, Request()->url()); StoreProduct::where('id', $params['product_id'])->update(['stock' => $stock, 'total_price' => bcmul($stock, $find['purchase'], 2)],['id'=>$params['product_id']]); } diff --git a/app/admin/logic/system_store_storage/SystemStoreStorageLogic.php b/app/admin/logic/system_store_storage/SystemStoreStorageLogic.php index 4e221db77..0a9208d50 100644 --- a/app/admin/logic/system_store_storage/SystemStoreStorageLogic.php +++ b/app/admin/logic/system_store_storage/SystemStoreStorageLogic.php @@ -70,11 +70,13 @@ class SystemStoreStorageLogic extends BaseLogic $branch_product=StoreBranchProduct::where(['product_id'=>$find['product_id'],'store_id'=>$find['store_id']])->find(); if($branch_product){ $branch_product->save(['stock'=>$branch_product['stock']+$find['nums']]); + SqlChannelLog('StoreBranchProduct', $branch_product['id'], $find['nums'], 1,Request()->url()); }else{ $storeProduct = StoreProduct::where('id', $find['product_id'])->findOrEmpty(); $storeBranchProduct = StoreProductLogic::ordinary(['id' => $find['product_id']], $find['store_id'], 0, $storeProduct); $storeBranchProduct->stock = $find['nums']; $storeBranchProduct->save(); + SqlChannelLog('StoreBranchProduct', $branch_product['id'], $find['nums'], 1,Request()->url()); } }else{ $find->save(['status'=>1,'staff_id'=>$params['staff_id']??0,'admin_id'=>$params['admin_id']??0,'mark'=>'确认时间:'.date('Y-m-d H:i:s',time())]); @@ -136,6 +138,7 @@ class SystemStoreStorageLogic extends BaseLogic $storage->status = 1; $storage->staff_id = $params['staff_id']; $storage->save(); + SqlChannelLog('StoreBranchProduct', $storage['id'], $storage['nums'], 1,Request()->url()); Db::commit(); return true; } catch (\Exception $e) { diff --git a/app/common/logic/DemoPayNotifyLogic.php b/app/common/logic/DemoPayNotifyLogic.php deleted file mode 100644 index e5025e496..000000000 --- a/app/common/logic/DemoPayNotifyLogic.php +++ /dev/null @@ -1,850 +0,0 @@ -getMessage() . ',lien:' . $e->getLine() . ',file:' . $e->getFile()); - throw new \Exception($e->getMessage()); - } - } - - /** - * 余额支付 - * @param $orderSn - * @param $extra - * @return bool - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\DbException - * @throws \think\db\exception\ModelNotFoundException - */ - public static function balancePay($orderSn, $extra = []) - { - $order = StoreOrder::where('order_id', $orderSn)->findOrEmpty(); - $user = User::where('id', $order['uid'])->find(); - if ($user['now_money'] < $order['pay_price']) { - throw new \Exception('余额不足'); - } - // $order->money = $order['pay_price']; - $order->paid = 1; - $order->pay_time = bcadd(strtotime($order['create_time']),rand(1,300)); - if (!$order->save()) { - throw new \Exception('订单保存出错'); - } - if ($order['is_storage'] == 1) { - $order->status = 2; - UserProductStorageLogic::add($order); - } - // 减去余额 - $user->now_money = bcsub($user['now_money'], $order['pay_price'], 2); - $user->save(); - - if ($order['spread_uid'] > 0 && $user['user_ship'] == 1) { - $oldUser = User::where('id', $order['spread_uid'])->value('purchase_funds'); - if ($oldUser < $order['pay_price']) { - $order['pay_price'] = $oldUser; - } - } - // self::addUserSing($order); - $capitalFlowDao = new CapitalFlowLogic($user); - $capitalFlowDao->userExpense('user_order_balance_pay', 'order', $order['id'], $order['pay_price'], '', 0, $order['store_id']); - self::dealProductLog($order); - if ($order['shipping_type'] == 3) { - // self::descStock($order['id']); - } - self::afterPay($order); - if ($order['reservation'] == 1 && in_array($order['shipping_type'], [1, 2])) { - $checkArr = [ - 'cart_id' => $order['cart_id'], - 'store_id' => $order['store_id'], - ]; - self::dealGoodsLeft($checkArr, $order['uid'], $order['id']); - } - if ($extra && $extra['store_id'] && $order['reservation'] !=1) { - $params = [ - 'verify_code' => $order['verify_code'], - 'store_id' => $extra['store_id'], - 'staff_id' => $extra['staff_id'] - ]; - OrderLogic::writeOff($params); - } - if(in_array($order['shipping_type'],[1,2])){ - PushService::push('store_merchant_' . $order['store_id'], $order['store_id'], ['type' => 'store_merchant', 'msg' => '您有一笔新的订单']); - } - return true; - // Redis::send('push-platform-print', ['id' => $order['id']], 60); - - } - - /** - * 礼品券支付 - * @param $orderSn - * @param $extra - * @return void - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\DbException - * @throws \think\db\exception\ModelNotFoundException - */ - - public static function gift_pay($orderSn, $extra = []) - { - $order = StoreOrder::where('order_id', $orderSn)->findOrEmpty(); - $user = User::where('id', $order['uid'])->find(); - if ($user['integral'] < $order['pay_price']) { - throw new \Exception('礼品券不足'); - } - $order->money = $order['pay_price']; - $order->paid = 1; - $order->pay_time = bcadd(strtotime($order['create_time']),rand(1,300)); - if (!$order->save()) { - throw new \Exception('订单保存出错'); - } - // 减去礼品券 - $user->integral = bcsub($user['integral'], $order['pay_price'], 2); - $user->save(); - //入礼品券表扣款记录 - $sing = [ - 'uid' => $order['uid'], - 'order_id' => $order['order_id'], - // 'title' => '订单扣除兑换券', - 'title' => 5, - 'financial_pm' => 0, - 'status' => 1, - 'store_id' => $order['store_id'], - 'number' => $order['pay_price'], - 'user_ship' => $user['user_ship'], - ]; - UserSign::create($sing); - - if ($extra && $extra['store_id']) { - $params = [ - 'verify_code' => $order['verify_code'], - 'store_id' => $extra['store_id'], - 'staff_id' => $extra['staff_id'] - ]; - OrderLogic::lessWriteOff($params); - } - self::dealProductLog($order); - } - - - /** - * 采购款支付 - * @param $orderSn - * @param $extra - * @return void - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\DbException - * @throws \think\db\exception\ModelNotFoundException - */ - public static function purchase_funds($orderSn, $extra = []) - { - $order = StoreOrder::where('order_id', $orderSn)->findOrEmpty(); - $user = User::where('id', $order['uid'])->find(); - if ($user['purchase_funds'] < $order['pay_price']) { - throw new \Exception('采购款不足'); - } - $order->money = $order['pay_price']; - $order->paid = 1; - $order->pay_time = bcadd(strtotime($order['create_time']),rand(1,300)); - if (!$order->save()) { - throw new \Exception('订单保存出错'); - } - if ($order['is_storage'] == 1) { - $order->status = 2; - UserProductStorageLogic::add($order); - } - // 减去采购款 - $user->purchase_funds = bcsub($user['purchase_funds'], $order['pay_price'], 2); - $user->save(); - - $capitalFlowDao = new CapitalFlowLogic($user); - $capitalFlowDao->userExpense('user_order_purchase_pay', 'order', $order['id'], $order['pay_price'], '', 1, $order['store_id']); - // if ($user['user_ship'] == 1) { - // self::dealVipAmount($order, PayEnum::PURCHASE_FUNDS); - // } - // self::addUserSing($order); - self::afterPay($order); - if ($extra && $extra['store_id'] && $order['reservation'] !=1) { - $params = [ - 'verify_code' => $order['verify_code'], - 'store_id' => $extra['store_id'], - 'staff_id' => $extra['staff_id'] - ]; - OrderLogic::writeOff($params); - } - self::dealProductLog($order); - if ($order['reservation'] == 1 && in_array($order['shipping_type'], [1, 2])) { - $checkArr = [ - 'cart_id' => $order['cart_id'], - 'store_id' => $order['store_id'], - ]; - self::dealGoodsLeft($checkArr, $order['uid'], $order['id']); - } - - // Redis::send('push-platform-print', ['id' => $order['id']], 60); - if(in_array($order['shipping_type'],[1,2])){ - PushService::push('store_merchant_' . $order['store_id'], $order['store_id'], ['type' => 'store_merchant', 'msg' => '您有一笔新的订单']); - } - } - - /** - * @notes 微信通用回调 - * @param $orderSn - * @param array $extra - * @date 2023/2/27 15:28 - */ - public static function wechat_common($orderSn, $extra = []) - { - $order = StoreOrder::where('order_id', $orderSn)->findOrEmpty(); - - if ($order->isEmpty() || $order->paid == PayEnum::ISPAID) { - return true; - } - $order->status = 1; - $order->paid = 1; - $order->pay_time = bcadd(strtotime($order['create_time']),rand(1,300)); - if ($order['is_storage'] == 1) { - $order->status = 2; - UserProductStorageLogic::add($order); - } - if ($order->pay_type != 10) { - $order->pay_price = bcdiv($extra['amount']['payer_total'], 100, 2); - } else { - $extra['transaction_id'] = time(); - } - $user = User::where('id', $order['uid'])->find(); - if ($order->pay_type == OrderEnum::CASHIER_ORDER_PAY || $order->pay_type == OrderEnum::CASHIER_ORDER_ALI_PAY) { //收银台支付 - $order->status = 2; - } else { - $capitalFlowDao = new CapitalFlowLogic($user); - //微信支付和用户余额无关 - $capitalFlowDao->userExpense('user_order_pay', 'order', $order['id'], $order->pay_price, '', 1, $order['store_id']); - } - $order->save(); - if ($order['reservation'] == 1 && in_array($order['shipping_type'], [1, 2])) { - $checkArr = [ - 'cart_id' => $order['cart_id'], - 'store_id' => $order['store_id'], - ]; - self::dealGoodsLeft($checkArr, $order['uid'], $order['id']); - } - self::afterPay($order, $extra['transaction_id']); - // self::addUserSing($order); - self::dealProductLog($order); - if ($order['shipping_type'] == 3) { - self::descStock($order['id']); - } - if (!empty($extra['payer']['openid']) && $order->pay_type == 7) { - Redis::send('push-delivery', ['order_id' => $order['order_id'], 'openid' => $extra['payer']['openid']], 4); - } - return true; - } - - //退款 - public static function refund($orderSn, $extra = []) - { - //更新状态 - $order = StoreOrder::where('order_id', $orderSn)->findOrEmpty(); - if ($order->isEmpty() || $order->status == OrderEnum::REFUND_PAY) { - //充值 - $orderRe = UserRecharge::where('order_id', $orderSn)->findOrEmpty(); - if ($orderRe->isEmpty() || $orderRe->status == -1) { - return true; - } - $orderRe->status = -1; - $orderRe->refund_price = $orderRe->price; - $orderRe->refund_time = time(); - $orderRe->remarks = ''; - $orderRe->save(); - $purchase_funds = User::where('id', $orderRe['uid'])->value('purchase_funds'); - $user = User::where('id', $orderRe['uid'])->find(); - $capitalFlowDao = new CapitalFlowLogic($user); - if ($purchase_funds >= $orderRe['price']) { - User::where('id', $orderRe['uid'])->dec('purchase_funds', $orderRe['refund_price'])->update(); - $capitalFlowDao->userExpense('user_balance_recharge_refund', 'order', $orderRe['id'], $orderRe['refund_price'], '', 1, $orderRe['store_id']); - } else { - User::where('id', $orderRe['uid'])->dec('purchase_funds', $purchase_funds)->update(); - $capitalFlowDao->userExpense('user_balance_recharge_refund', 'order', $orderRe['id'], $purchase_funds, '', 1, $orderRe['store_id']); - } - //退还 充值得兑换券 - UserSignLogic::RefundRecharge($orderRe); - return true; - } - $order->status = OrderEnum::REFUND_PAY; - $order->refund_status = OrderEnum::REFUND_STATUS_FINISH; - $order->refund_price = bcdiv($extra['amount']['refund'], 100, 2); - $order->refund_reason_time = time(); - $order->refund_num += 1; - $order->save(); - //日志记录 - //加用户余额,采购款, 日志记录 加数量 - $user = User::where('id', $order['uid'])->findOrEmpty(); - $capitalFlowDao = new CapitalFlowLogic($user); - $deal_money = bcdiv($extra['amount']['refund'], 100, 2); - //对应比例得退礼品券逻辑 - $discount = self::getDiscount($user->user_ship); - $total_price = bcmul($order->refund_price, $discount, 2); - if (in_array($order['pay_type'], [PayEnum::BALANCE_PAY, PayEnum::PURCHASE_FUNDS])) { - if ($order['pay_type'] == PayEnum::BALANCE_PAY) { //用户余额支付 - $user->now_money = bcadd($user->now_money, $deal_money, 2); - $user->save(); - //增加数量 - self::addStock($order['id']); - //退款 - $capitalFlowDao->userIncome('system_balance_back', 'system_back', $order['id'], $deal_money); - } - if ($order['pay_type'] == PayEnum::PURCHASE_FUNDS) { //采购款支付 - $user->purchase_funds = bcadd($user->purchase_funds, $deal_money, 2); - $user->save(); - //增加数量 - self::addStock($order['id']); - //退款 - $capitalFlowDao->userIncome('system_purchase_back', 'system_back', $order['id'], $deal_money); - } - UserSignLogic::RefundOrder($order); - - return true; - } - //积分 - UserSignLogic::RefundOrder($order); - //微信日志 user_order_refund - $capitalFlowDao->userIncome('user_order_refund', 'system_back', $order['id'], $deal_money, '', 1); - //处理财务流水退还 - (new StoreFinanceFlowLogic())->store_finance_back($orderSn,$order['store_id']); - self::addStock($order['id']); //微信 - return true; - // self::afterPay($order,$extra['transaction_id']); - } - - /** - * 现金退款相关 - * @param $orderSn - * @param $extra - * @return true - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\DbException - * @throws \think\db\exception\ModelNotFoundException - */ - public static function cash_refund($orderSn, $extra = []) - { - $order = StoreOrder::where('order_id', $orderSn)->findOrEmpty(); - if ($order->isEmpty() || $order->status == OrderEnum::REFUND_PAY) { - return true; - } - $order->refund_status = OrderEnum::REFUND_STATUS_FINISH; - $order->refund_price = $order->pay_price; - $order->refund_reason_time = time(); - $order->refund_num += 1; - $order->save(); - //日志记录 - $model = new StoreCashFinanceFlow(); - $model->store_id = $order['store_id'] ?? 0; - $model->cash_price = $order->pay_price; - $model->receivable = $order->pay_price; - $model->remark = '退款'; - $model->type = 1; - $model->status = YesNoEnum::YES; - $model->save(); - //增加数量 - self::addStock($order['id']); - return true; - } - - /** - * 充值现金退款相关 - * @param $orderId - * @param $extra - * @return true - */ - public static function recharge_cash_refund($orderId, $extra = []) - { - $order = UserRecharge::where('id', $orderId)->findOrEmpty(); - if ($order->isEmpty() || $order->status == -1) { - return true; - } - $order->status = -1; - $order->refund_price = $order->price; - $order->refund_time = time(); - $order->remarks = ''; - $order->save(); - return true; - } - - /** - * 充值 - */ - public static function recharge($orderSn, $extra = [], $type = 'wechat') - { - $order = UserRecharge::where('order_id', $orderSn)->findOrEmpty(); - if ($order->isEmpty() || $order->paid == PayEnum::ISPAID) { - return true; - } - if ($type == 'wechat') { - $price = bcdiv($extra['amount']['payer_total'], 100, 2); - } else { - $price = $extra['buyer_pay_amount']; - } - $order->price = $price; - $order->paid = 1; - $order->pay_time = bcadd(strtotime($order['create_time']),rand(1,300)); - $order->save(); - $uid = $order->uid; - $user = User::where('id', $uid)->findOrEmpty(); - //check store_id - if(empty($user->store_id)){ - $user->store_id = $order['store_id']; - } - - //用户的财务add - $capitalFlowDao = new CapitalFlowLogic($user); - $capitalFlowDao->userIncome('user_balance_recharge', 'user_recharge', $order['id'], $price, [], 1); - - if ($user->isEmpty()) { - return true; - } - bcscale(2); - - UserSignLogic::dealRechargeFrozen($user, $order, $order['user_ship']); - - //更新等级 - $user->user_ship = $order['user_ship']; - - $user->purchase_funds = bcadd($user->purchase_funds, $price, 2); - $user->total_recharge_amount = bcadd($user->total_recharge_amount, $price, 2); - $user->save(); - if ($order['other_uid'] > 0) { - $uid = $order['other_uid']; - } - - - PushService::push('wechat_mmp_' . $uid, $uid, ['type' => 'INDUSTRYMEMBERS', 'msg' => '订单支付成功', 'data' => ['id' => $order['id'], 'paid' => 1]]); - PushService::push('store_merchant_' . $order['store_id'], $order['store_id'], ['type' => 'INDUSTRYMEMBERS', 'msg' => '订单支付成功', 'data' => ['id' => $order['id'], 'paid' => 1]]); - if (!empty($extra['payer']['openid'])) { - Redis::send('push-delivery', ['order_id' => $order['order_id'], 'openid' => $extra['payer']['openid'], 'logistics_type' => 3], 4); - } - return true; - } - - /** - * 现金支付 - */ - public static function cash_pay($orderSn,$extra =[]) - { - $order = StoreOrder::where('order_id', $orderSn)->findOrEmpty(); - - if ($order->isEmpty() || $order->paid == PayEnum::ISPAID) { - return true; - } - $order->paid = 1; - $order->pay_time = strtotime($order['create_time']); - $order->status = 2; - if ($order['reservation'] ==1) { - $order->status = 1; - } - if (!$order->save()) { - throw new \Exception('订单保存出错'); - } - self::afterPay($order); - if ($order['is_storage'] == 1) { - UserProductStorageLogic::add($order); - } - $cashFlowLogic = new CashFlowLogic(); - $cashFlowLogic->insert($order['store_id'], $order['pay_price']); - self::dealProductLog($order); - - if ($order['shipping_type'] == 3) { - self::descStock($order['id']); - } - - if ($extra && $extra['store_id'] && $order['reservation'] !=1) { - $params = [ - 'verify_code' => $order['verify_code'], - 'store_id' => $extra['store_id'], - 'staff_id' => $extra['staff_id'] - ]; - OrderLogic::writeOff($params); - } - - - // Redis::send('push-platform-print', ['id' => $order['id']]); - return true; - } - - /** - * @notes 阿里回调 - * @param $orderSn - * @param array $extra - * @author 段誉 - * @date 2023/2/27 15:28 - */ - public static function alipay_cashier($orderSn, $extra = []) - { - $order = StoreOrder::where('order_id', $orderSn)->findOrEmpty(); - - if ($order->isEmpty() || $order->paid == PayEnum::ISPAID) { - return true; - } - if ($order->pay_type != 10) { - $order->money = $extra['buyer_pay_amount']; - $order->paid = 1; - $order->pay_time = bcadd(strtotime($order['create_time']),rand(1,300)); - $order->status = 1; - $order->save(); - } else { - $extra['transaction_id'] = time(); - } - if ($order->pay_type == 9) { - $order->status = 2; - self::afterPay($order); - UserProductStorageLogic::add($order); - } - self::dealProductLog($order); - if ($order['shipping_type'] == 3) { - self::descStock($order['id']); - } - - // if ($order->pay_type == 9) { - // $extra['create_time'] = $order['create_time']; - // PushService::push('store_merchant_' . $order['store_id'], $order['store_id'], ['type' => 'cash_register', 'msg' => '您有一笔订单已支付', 'data' => $extra]); - // Redis::send('push-platform-print', ['id' => $order['id']]); - // } - // else { - // PushService::push('store_merchant_' . $order['store_id'], $order['store_id'], ['type' => 'store_merchant', 'msg' => '您有一笔新的订单']); - // } - return true; - } - - /** - * 支付后逻辑 - * @param $order - * @return void - */ - public static function afterPay($order, $transaction_id = 0) - { - $financeLogic = new StoreFinanceFlowLogic(); - $off_activity = Config::where('name', 'off_activity')->value('value'); - $village_uid = 0; - $brigade_uid = 0; - $user_ship = 0; - $order['dealVipAmount'] = 0; - try { - Redis::send('order_wetcha_push_send', ['order' => $order]); - } catch (\Exception $e) { - Log::error('订单推送失败:' . $e->getMessage()); - // 异常处理代码,例如记录日志或发送通知等。 - } - if ($order['uid'] > 0) { - // 结算金额 要支付的钱减去冻结得钱去走后面得逻辑 发得兑换券也要去减去 - //用户下单该用户等级为1得时候才处理冻结金额 - $user = User::where('id', $order['uid'])->find(); - $user_ship = $user['user_ship']; - - } - //积分写入 - if(isset($user) && $user['user_ship']==0){ - UserSignLogic::OrderWrite($order); - } - if ($off_activity == 1) { - //-----活动价结算更改 - $financeLogic->order = $order; - $financeLogic->user = ['uid' => $order['uid']]; - $financeLogic->in($transaction_id, $order['pay_price'], OrderEnum::USER_ORDER_PAY, $order['store_id'], $order['staff_id'], 0, $order['pay_type']); //用户订单支付 - $financeLogic->in($transaction_id, $order['pay_price'], OrderEnum::SUPPLIER_ORDER_OBTAINS, $order['store_id'], 0, 0, $order['pay_type']); - $financeLogic->out($transaction_id, $order['pay_price'], OrderEnum::SUPPLIER_ORDER_OBTAINS, $order['store_id'], $order['staff_id'], 0, $order['pay_type']); - $financeLogic->save(); - return false; - } - - } - - /** - * 回调日志 - * @param $order - * @param $extra - * @return void - */ - public static function notifyLog($order, $extra) - { - $data = [ - 'pay_type' => 'wechat', - 'type' => OrderEnum::PAY, - 'amount' => $extra['amount']['payer_total'], //分 - 'order_sn' => $order, - 'out_trade_no' => $extra['transaction_id'], - 'attach' => $extra['attach'], - 'create_time' => date('Y-m-d H:i:s', time()), - ]; - PayNotify::create($data); - } - - /** - * 冻结金额 - * @param $oid - * @return int|mixed - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\DbException - * @throws \think\db\exception\ModelNotFoundException - */ - - public static function dealFrozenPrice($oid) - { - $detail = StoreOrderCartInfo::where('oid', $oid)->select()->toArray(); - $total_vip = 0; - foreach ($detail as $value) { - $total_vip += $value['cart_info']['vip_frozen_price']; - } - return $total_vip; - } - - - /** - * 处理用户为vip1时得冻结资金 - * @param $order - * @param $pay_type - * @param $transaction_id - * @return true - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\DbException - * @throws \think\db\exception\ModelNotFoundException - */ - public static function dealVipAmount($order, $pay_type = 1, $transaction_id = 0) - { - $total_vip = self::dealFrozenPrice($order['id']); - $data = [ - 'order_id' => $order['id'], - 'transaction_id' => $transaction_id ?? 0, - 'order_sn' => $order['order_id'], - 'user_id' => $order['uid'], - 'number' => $total_vip, - 'all' => $order['pay_price'], - 'pay_type' => $pay_type ?? 1, - 'status' => 0, - 'store_id' => $order['store_id'], - 'staff_id' => $order['staff_id'], - 'create_time' => time() - ]; - Db::name('vip_flow')->insert($data); - return $total_vip; - } - - /** - * 商品统计逻辑 - * @param $order - * @return true - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\DbException - * @throws \think\db\exception\ModelNotFoundException - */ - public static function dealProductLog($order) - { - $store_id = $order['store_id']; - $cart_id = $order['cart_id']; - $uid = $order['uid']; - if ($uid && $cart_id && $store_id) { - $cart_id = explode(',', $cart_id); - $productLog = StoreProductLog::where([ - 'uid' => $uid - ])->whereIn('cart_id', $cart_id) - ->select()->toArray(); - - foreach ($productLog as &$value) { - $value['pay_uid'] = $uid; - $value['oid'] = $order['id']; - $value['store_id'] = $store_id; - $cart_info = StoreOrderCartInfo::where([ - 'uid' => $uid, 'old_cart_id' => $value['cart_id'], 'oid' => $value['oid'] - ])->find(); - $value['order_num'] = $cart_info['cart_num'] ?? 1; - $value['pay_num'] = $cart_info['cart_num'] ?? 1; - $value['pay_price'] = $cart_info['price'] ?? 0; - $value['cost_price'] = $cart_info['cart_info']['cost'] ?? 0; - $value['update_time'] = time(); - unset($value['create_time'], $value['delete_time']); - } - - (new StoreProductLog())->saveAll($productLog); - } - return true; - } - - - public static function descSwap($oid) - { - $updateData = []; - $goods_list = StoreOrderCartInfo::where('oid', $oid)->select()->toArray(); - foreach ($goods_list as $v) { - $StoreBranchProduct = StoreBranchProduct::where( - [ - 'store_id' => $v['store_id'], - 'product_id' => $v['product_id'], - ] - )->withTrashed()->find(); - $updateData[] = [ - 'id' => $StoreBranchProduct['id'], - 'swap' => $StoreBranchProduct['swap'] - $v['cart_num'], - 'sales' => ['inc', $v['cart_num']] - ]; - } - - (new StoreBranchProduct())->saveAll($updateData); - } - - - /** - * 扣库存 - * @param $oid - * @return void - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\DbException - * @throws \think\db\exception\ModelNotFoundException - */ - public static function descStock($oid) - { - $updateData = []; - $goods_list = StoreOrderCartInfo::where('oid', $oid)->select()->toArray(); - foreach ($goods_list as $v) { - $StoreBranchProduct = StoreBranchProduct::where( - [ - 'store_id' => $v['store_id'], - 'product_id' => $v['product_id'], - ] - )->withTrashed()->find(); - if ($StoreBranchProduct) { - $updateData[] = [ - 'id' => $StoreBranchProduct['id'], - 'stock' => $StoreBranchProduct['stock'] - $v['cart_num'], - 'sales' => ['inc', $v['cart_num']] - ]; - } - } - - (new StoreBranchProduct())->saveAll($updateData); - } - - /** - * 加库存 - * @param $oid - * @return void - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\DbException - * @throws \think\db\exception\ModelNotFoundException - */ - public static function addStock($oid) - { - $updateData = []; - $goods_list = StoreOrderCartInfo::where('oid', $oid)->select()->toArray(); - foreach ($goods_list as $v) { - $StoreBranchProduct = StoreBranchProduct::where( - [ - 'store_id' => $v['store_id'], - 'product_id' => $v['product_id'], - ] - )->withTrashed()->find(); - if ($StoreBranchProduct) { - $updateData[] = [ - 'id' => $StoreBranchProduct['id'], - 'stock' => $StoreBranchProduct['stock'] + $v['cart_num'], - // 'sales' => ['inc', $v['cart_num']] - // 'sales' => ['inc', $v['cart_num']] - ]; - } - } - - (new StoreBranchProduct())->saveAll($updateData); - } - - - /** - * 处理商品缺失新增到缺失列表 - * @param $cart_id //购物车ids - * @param $uid //用户id - * @param $oid //订单id - * @return void - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\DbException - * @throws \think\db\exception\ModelNotFoundException - */ - public static function dealGoodsLeft($cart_id, $uid, $oid) - { - if (is_array($cart_id)) { - $cart_id['cart_id'] = $cart_id; - } else { - $cart_id['cart_id'] = explode(',', $cart_id); - } - $data = OrderLogic::checkLeft($cart_id, $uid, 1); - $format = $data['detail']; - foreach ($format as &$value) { - $value['oid'] = $oid; - $value['create_time'] = time(); - } - Db::name('store_product_miss')->insertAll($format); - } - - - - /** - * 会员等级对应得折扣比例 - * @param $level - * @return float|mixed - */ - public static function getDiscount($level) - { - switch ($level) { - case 0: //普通 - return Config::where('name', 'ordinary_member')->value('value') ?? 0.1; - case 1: //vip - return Config::where('name', 'vip_member')->value('value') ?? 0.1; - case 4: //商户 - return Config::where('name', 'merchant')->value('value') ?? 0.1; - default: - return 0.1; - } - } -} diff --git a/app/common/logic/PayNotifyLogic.php b/app/common/logic/PayNotifyLogic.php index c91074eee..434fd546e 100644 --- a/app/common/logic/PayNotifyLogic.php +++ b/app/common/logic/PayNotifyLogic.php @@ -34,6 +34,7 @@ use app\common\model\vip_flow\VipFlow; use app\common\service\Curl; use app\common\service\PushService; use app\common\service\xpyun\XpsdkPrintApi; +use app\Request; use support\exception\BusinessException; use support\Log; use think\facade\Db; @@ -627,12 +628,14 @@ class PayNotifyLogic extends BaseLogic 'total_price' => bcmul($stock, $branchProduct['purchase'], 2), 'sales' => bcadd($branchProduct['sales'], $v['cart_num'], 2) ], ['id' => $branchProduct['id']]); + SqlChannelLog('StoreBranchProduct',$branchProduct['id'], $v['cart_num'], -1, Request()->url()); } else { StoreProductLogic::ordinary(['id' => $v['product_id']], $v['store_id'], 0, $storeProduct); StoreBranchProduct::update([ 'stock' => -$v['cart_num'], 'sales' => $v['cart_num'] ], ['product_id' => $v['product_id'],'store_id'=>$v['store_id']]); + SqlChannelLog('StoreBranchProduct',$branchProduct['id'], $v['cart_num'], -1, Request()->url()); } } } catch (\Throwable $e) { @@ -874,6 +877,7 @@ class PayNotifyLogic extends BaseLogic } (new StoreBranchProduct())->saveAll($updateData); + SqlChannelLog('StoreBranchProduct',0,0,1,Request()->url()); } diff --git a/app/common/logic/store_order/StoreOrderLogic.php b/app/common/logic/store_order/StoreOrderLogic.php index a67acfad3..0c68cec6a 100644 --- a/app/common/logic/store_order/StoreOrderLogic.php +++ b/app/common/logic/store_order/StoreOrderLogic.php @@ -215,6 +215,7 @@ class StoreOrderLogic extends BaseLogic (new StoreOrderCartInfo())->saveAll($goods_list); $where = ['is_pay' => 0]; (new StoreBranchProduct())->saveAll($updateData); + SqlChannelLog('StoreBranchProduct', 0, $v['cart_num'], -1, Request()->url()); (new StoreProduct())->saveAll($updateDataTwo); Cart::whereIn('id', $cartId)->where($where)->update(['is_pay' => 1]); Db::commit(); From abf1e55bc7d1e2e8ca77ecbab609b402f68efeac Mon Sep 17 00:00:00 2001 From: lewis <604446095@qq.com> Date: Sat, 4 Jan 2025 10:31:17 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AE=9A=E6=97=B6?= =?UTF-8?q?=E7=A1=AE=E8=AE=A4=E5=95=86=E5=93=81=E6=94=B9=E4=BB=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- process/Task.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/process/Task.php b/process/Task.php index aa10565b3..fec68c71a 100644 --- a/process/Task.php +++ b/process/Task.php @@ -67,6 +67,31 @@ class Task }); $this->updateProductPrice(); + $this->confirmProductPrice(); + } + + /** + * 确认商品改价 + * @return void + */ + public function confirmProductPrice() + { + new Crontab('0 */10 * * * *', function () { + $value = DictData::getDictValue('update_product_price_task', 'confirm'); + if ($value == 1) { + $list = StoreProductPrice::where('status', 0)->select()->toArray(); + $update = []; + foreach ($list as $item) { + $update[] = [ + 'id' => $item['id'], + 'status' => 1, + ]; + } + if (count($update) > 0) { + (new StoreProduct())->saveAll($update); + } + } + }); } /** From 5cd88dfb0826c6f904f4e9cbf751c2c567459486 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Sat, 4 Jan 2025 10:34:38 +0800 Subject: [PATCH 4/4] =?UTF-8?q?feat(model):=20=E4=B8=BA=E5=A4=9A=E4=B8=AA?= =?UTF-8?q?=E6=A8=A1=E5=9E=8B=E6=B7=BB=E5=8A=A0=E4=B8=8D=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在多个模型中添加 $doNotRecordLog 属性,设置为 true - 这样可以避免为这些表生成日志,减少不必要的数据记录 - 主要涉及活动区域、配置、操作日志、APP更新、管理员、菜单、角色等模型 --- app/common/model/ActivityZone.php | 4 ++- app/common/model/ActivityZoneForm.php | 3 +- app/common/model/Config.php | 3 +- app/common/model/OperationLog.php | 3 +- app/common/model/app_update/AppUpdate.php | 3 +- app/common/model/auth/Admin.php | 3 +- app/common/model/auth/AdminDept.php | 4 ++- app/common/model/auth/AdminJobs.php | 4 ++- app/common/model/auth/AdminRole.php | 5 +-- app/common/model/auth/AdminSession.php | 4 ++- app/common/model/auth/SystemMenu.php | 3 +- app/common/model/auth/SystemRole.php | 3 +- app/common/model/auth/SystemRoleMenu.php | 3 +- .../beforehand_order/BeforehandOrder.php | 3 +- .../BeforehandOrderCartInfo.php | 3 +- .../BeforehandOrderRecord.php | 3 +- app/common/model/cate/Cate.php | 3 +- .../delivery_service/DeliveryService.php | 3 +- app/common/model/dept/Dept.php | 3 +- app/common/model/dept/Jobs.php | 3 +- app/common/model/dict/DictData.php | 3 +- app/common/model/dict/DictType.php | 3 +- .../model/distribution/Distribution.php | 3 +- app/common/model/file/File.php | 4 ++- app/common/model/file/FileCate.php | 4 ++- app/common/model/finance/CapitalFlow.php | 3 +- app/common/model/finance/PayNotifyLog.php | 3 +- .../FinancialTransfers.php | 3 +- app/common/model/geo/GeoArea.php | 3 +- app/common/model/geo/GeoBrigade.php | 3 +- app/common/model/geo/GeoCity.php | 3 +- app/common/model/geo/GeoProvince.php | 3 +- app/common/model/geo/GeoStreet.php | 3 +- app/common/model/geo/GeoVillage.php | 3 +- app/common/model/merchant/Merchant.php | 3 +- app/common/model/order/Cart.php | 3 +- app/common/model/pay/PayConfig.php | 3 +- app/common/model/pay/PayNotify.php | 4 ++- app/common/model/pay/PayWay.php | 3 +- .../model/purchase_order/PurchaseOrder.php | 7 ++-- .../purchase_order_info/PurchaseOrderInfo.php | 3 +- .../PurchaseProductOffer.php | 3 +- app/common/model/setting/Category.php | 3 +- .../StoreBranchProductAttrValue.php | 3 +- .../StoreBranchProductExchange.php | 3 +- .../StoreCashFinanceFlow.php | 5 +-- .../model/store_category/StoreCategory.php | 5 +-- .../model/store_extract/StoreExtract.php | 3 +- .../store_finance_flow/StoreFinanceFlow.php | 3 +- .../StoreFinanceFlowProduct.php | 4 ++- app/common/model/store_order/StoreOrder.php | 33 ++++++++++--------- .../StoreOrderCartInfo.php | 3 +- .../StoreOrderTransshipmentInfo.php | 4 +-- .../StoreProductAttrValue.php | 3 +- .../store_product_cate/StoreProductCate.php | 3 +- .../store_product_gift/StoreProductGift.php | 3 +- .../StoreProductGroupPrice.php | 3 +- .../store_product_log/StoreProductLog.php | 3 +- .../store_product_price/StoreProductPrice.php | 3 +- .../store_product_unit/StoreProductUnit.php | 3 +- app/common/model/store_visit/StoreVisit.php | 3 +- app/common/model/supplier/Supplier.php | 3 +- .../model/system_store/DeliveryService.php | 3 +- app/common/model/system_store/SystemStore.php | 3 +- .../model/system_store/SystemStoreMenu.php | 3 +- .../model/system_store/SystemStoreStaff.php | 3 +- .../system_store/SystemStoreStaffSession.php | 3 +- app/common/model/tools/GenerateColumn.php | 3 +- app/common/model/tools/GenerateTable.php | 3 +- app/common/model/user/User.php | 3 +- app/common/model/user/UserAddress.php | 3 +- app/common/model/user/UserAuth.php | 3 +- app/common/model/user/UserFeedback.php | 3 +- app/common/model/user/UserRecharge.php | 3 +- app/common/model/user/UserSession.php | 3 +- app/common/model/user/UserVisit.php | 3 +- app/common/model/user_bill/UserBill.php | 3 +- .../model/user_create_log/UserCreateLog.php | 3 +- app/common/model/user_label/UserLabel.php | 3 +- .../UserProductStorage.php | 4 ++- .../UserProductStorageLog.php | 6 ++-- .../model/user_recharge/UserRecharge.php | 3 +- app/common/model/user_ship/UserShip.php | 4 ++- app/common/model/user_sign/UserSign.php | 3 +- .../model/user_sign_log/UserSignLog.php | 3 +- .../model/user_spread_log/UserSpreadLog.php | 3 +- app/common/model/vip_flow/VipFlow.php | 3 +- app/common/model/warehouse/Warehouse.php | 3 +- .../model/warehouse_order/WarehouseOrder.php | 3 +- .../WarehouseProductReturn.php | 2 -- 90 files changed, 210 insertions(+), 113 deletions(-) diff --git a/app/common/model/ActivityZone.php b/app/common/model/ActivityZone.php index 62bf752b3..6d2b51311 100644 --- a/app/common/model/ActivityZone.php +++ b/app/common/model/ActivityZone.php @@ -18,7 +18,9 @@ class ActivityZone extends BaseModel use SoftDelete; protected $name = 'activity_zone'; protected $deleteTime = 'delete_time'; - + // 不生成该表的日志 + public $doNotRecordLog = true; + public function product() { return $this->hasOne(StoreProduct::class, 'id', 'product_id')->bind(['store_name', 'unit']); diff --git a/app/common/model/ActivityZoneForm.php b/app/common/model/ActivityZoneForm.php index ab50bf525..77e7757e3 100644 --- a/app/common/model/ActivityZoneForm.php +++ b/app/common/model/ActivityZoneForm.php @@ -15,5 +15,6 @@ class ActivityZoneForm extends BaseModel use SoftDelete; protected $name = 'activity_zone_form'; protected $deleteTime = 'delete_time'; - + // 不生成该表的日志 + public $doNotRecordLog = true; } \ No newline at end of file diff --git a/app/common/model/Config.php b/app/common/model/Config.php index d2f9daf41..f47ffbb01 100644 --- a/app/common/model/Config.php +++ b/app/common/model/Config.php @@ -6,5 +6,6 @@ namespace app\common\model; class Config extends BaseModel { - + // 不生成该表的日志 + public $doNotRecordLog = true; } \ No newline at end of file diff --git a/app/common/model/OperationLog.php b/app/common/model/OperationLog.php index ff67252ff..616413fd8 100644 --- a/app/common/model/OperationLog.php +++ b/app/common/model/OperationLog.php @@ -7,5 +7,6 @@ namespace app\common\model; class OperationLog extends BaseModel { // protected $json = ['params']; - + // 不生成该表的日志 + public $doNotRecordLog = true; } \ No newline at end of file diff --git a/app/common/model/app_update/AppUpdate.php b/app/common/model/app_update/AppUpdate.php index 4de527b6d..09d483f5c 100644 --- a/app/common/model/app_update/AppUpdate.php +++ b/app/common/model/app_update/AppUpdate.php @@ -17,6 +17,7 @@ class AppUpdate extends BaseModel use SoftDelete; protected $name = 'app_update'; protected $deleteTime = 'delete_time'; - + // 不生成该表的日志 + public $doNotRecordLog = true; } \ No newline at end of file diff --git a/app/common/model/auth/Admin.php b/app/common/model/auth/Admin.php index 1033db23f..7ca0f36ed 100644 --- a/app/common/model/auth/Admin.php +++ b/app/common/model/auth/Admin.php @@ -12,7 +12,8 @@ use think\model\concern\SoftDelete; class Admin extends BaseModel { use SoftDelete; - + // 不生成该表的日志 + public $doNotRecordLog = true; protected $deleteTime = 'delete_time'; protected $append = [ diff --git a/app/common/model/auth/AdminDept.php b/app/common/model/auth/AdminDept.php index a6e7a7337..4c1b19d45 100644 --- a/app/common/model/auth/AdminDept.php +++ b/app/common/model/auth/AdminDept.php @@ -18,6 +18,8 @@ use app\common\model\BaseModel; class AdminDept extends BaseModel { + // 不生成该表的日志 + public $doNotRecordLog = true; /** * @notes 删除用户关联部门 * @param $adminId @@ -29,4 +31,4 @@ class AdminDept extends BaseModel { return self::where(['admin_id' => $adminId])->delete(); } -} \ No newline at end of file +} diff --git a/app/common/model/auth/AdminJobs.php b/app/common/model/auth/AdminJobs.php index 240b11c7d..5c496692d 100644 --- a/app/common/model/auth/AdminJobs.php +++ b/app/common/model/auth/AdminJobs.php @@ -18,6 +18,8 @@ use app\common\model\BaseModel; class AdminJobs extends BaseModel { + // 不生成该表的日志 + public $doNotRecordLog = true; /** * @notes 删除用户关联岗位 * @param $adminId @@ -29,4 +31,4 @@ class AdminJobs extends BaseModel { return self::where(['admin_id' => $adminId])->delete(); } -} \ No newline at end of file +} diff --git a/app/common/model/auth/AdminRole.php b/app/common/model/auth/AdminRole.php index 2d0afc45b..eb0ab6f8e 100644 --- a/app/common/model/auth/AdminRole.php +++ b/app/common/model/auth/AdminRole.php @@ -19,6 +19,8 @@ use app\common\model\BaseModel; class AdminRole extends BaseModel { + // 不生成该表的日志 + public $doNotRecordLog = true; /** * @notes 删除用户关联角色 * @param $adminId @@ -30,5 +32,4 @@ class AdminRole extends BaseModel { return self::where(['admin_id' => $adminId])->delete(); } - -} \ No newline at end of file +} diff --git a/app/common/model/auth/AdminSession.php b/app/common/model/auth/AdminSession.php index 9f18a3698..b603d5531 100644 --- a/app/common/model/auth/AdminSession.php +++ b/app/common/model/auth/AdminSession.php @@ -18,6 +18,8 @@ use app\common\model\BaseModel; class AdminSession extends BaseModel { + // 不生成该表的日志 + public $doNotRecordLog = true; /** * @notes 关联管理员表 * @return \think\model\relation\HasOne @@ -29,4 +31,4 @@ class AdminSession extends BaseModel return $this->hasOne(Admin::class, 'id', 'admin_id') ->field('id,multipoint_login'); } -} \ No newline at end of file +} diff --git a/app/common/model/auth/SystemMenu.php b/app/common/model/auth/SystemMenu.php index 7d94bbf70..792b17e16 100644 --- a/app/common/model/auth/SystemMenu.php +++ b/app/common/model/auth/SystemMenu.php @@ -25,7 +25,8 @@ use app\common\model\BaseModel; */ class SystemMenu extends BaseModel { - + // 不生成该表的日志 + public $doNotRecordLog = true; } \ No newline at end of file diff --git a/app/common/model/auth/SystemRole.php b/app/common/model/auth/SystemRole.php index 71b785571..2fc984b0c 100644 --- a/app/common/model/auth/SystemRole.php +++ b/app/common/model/auth/SystemRole.php @@ -25,7 +25,8 @@ use think\model\concern\SoftDelete; class SystemRole extends BaseModel { use SoftDelete; - + // 不生成该表的日志 + public $doNotRecordLog = true; protected $deleteTime = 'delete_time'; protected $name = 'system_role'; diff --git a/app/common/model/auth/SystemRoleMenu.php b/app/common/model/auth/SystemRoleMenu.php index f5e0d0329..4edb5b6d7 100644 --- a/app/common/model/auth/SystemRoleMenu.php +++ b/app/common/model/auth/SystemRoleMenu.php @@ -25,6 +25,7 @@ use app\common\model\BaseModel; */ class SystemRoleMenu extends BaseModel { - + // 不生成该表的日志 + public $doNotRecordLog = true; } \ No newline at end of file diff --git a/app/common/model/beforehand_order/BeforehandOrder.php b/app/common/model/beforehand_order/BeforehandOrder.php index 50a4fda14..ee34f8863 100644 --- a/app/common/model/beforehand_order/BeforehandOrder.php +++ b/app/common/model/beforehand_order/BeforehandOrder.php @@ -18,6 +18,7 @@ class BeforehandOrder extends BaseModel protected $name = 'beforehand_order'; protected $deleteTime = 'delete_time'; protected $json = ['other_data']; - + // 不生成该表的日志 + public $doNotRecordLog = true; } \ No newline at end of file diff --git a/app/common/model/beforehand_order_cart_info/BeforehandOrderCartInfo.php b/app/common/model/beforehand_order_cart_info/BeforehandOrderCartInfo.php index bd017fa27..50760511c 100644 --- a/app/common/model/beforehand_order_cart_info/BeforehandOrderCartInfo.php +++ b/app/common/model/beforehand_order_cart_info/BeforehandOrderCartInfo.php @@ -17,6 +17,7 @@ class BeforehandOrderCartInfo extends BaseModel use SoftDelete; protected $name = 'beforehand_order_cart_info'; protected $deleteTime = 'delete_time'; - + // 不生成该表的日志 + public $doNotRecordLog = true; } \ No newline at end of file diff --git a/app/common/model/beforehand_order_record/BeforehandOrderRecord.php b/app/common/model/beforehand_order_record/BeforehandOrderRecord.php index c2fc83f03..92bf81433 100644 --- a/app/common/model/beforehand_order_record/BeforehandOrderRecord.php +++ b/app/common/model/beforehand_order_record/BeforehandOrderRecord.php @@ -17,6 +17,7 @@ class BeforehandOrderRecord extends BaseModel use SoftDelete; protected $name = 'beforehand_order_record'; protected $deleteTime = 'delete_time'; - + // 不生成该表的日志 + public $doNotRecordLog = true; } \ No newline at end of file diff --git a/app/common/model/cate/Cate.php b/app/common/model/cate/Cate.php index cb2506c7e..86b8bb56b 100644 --- a/app/common/model/cate/Cate.php +++ b/app/common/model/cate/Cate.php @@ -17,7 +17,8 @@ class Cate extends BaseModel use SoftDelete; protected $name = 'store_category'; protected $deleteTime = 'delete_time'; - + // 不生成该表的日志 + public $doNotRecordLog = true; public function getChildrenAttr($value) { if($value){ diff --git a/app/common/model/delivery_service/DeliveryService.php b/app/common/model/delivery_service/DeliveryService.php index 6c0789f06..6ab230fc6 100644 --- a/app/common/model/delivery_service/DeliveryService.php +++ b/app/common/model/delivery_service/DeliveryService.php @@ -17,6 +17,7 @@ class DeliveryService extends BaseModel use SoftDelete; protected $name = 'delivery_service'; protected $deleteTime = 'delete_time'; - + // 不生成该表的日志 + public $doNotRecordLog = true; } \ No newline at end of file diff --git a/app/common/model/dept/Dept.php b/app/common/model/dept/Dept.php index 82c8cb2aa..70b6eded8 100644 --- a/app/common/model/dept/Dept.php +++ b/app/common/model/dept/Dept.php @@ -29,7 +29,8 @@ class Dept extends BaseModel use SoftDelete; protected $deleteTime = 'delete_time'; - + // 不生成该表的日志 + public $doNotRecordLog = true; /** * @notes 状态描述 * @param $value diff --git a/app/common/model/dept/Jobs.php b/app/common/model/dept/Jobs.php index 5c2c934c9..ce569177c 100644 --- a/app/common/model/dept/Jobs.php +++ b/app/common/model/dept/Jobs.php @@ -28,7 +28,8 @@ class Jobs extends BaseModel use SoftDelete; protected $deleteTime = 'delete_time'; - + // 不生成该表的日志 + public $doNotRecordLog = true; /** * @notes 状态描述 * @param $value diff --git a/app/common/model/dict/DictData.php b/app/common/model/dict/DictData.php index b4f24bcbb..75b672b84 100644 --- a/app/common/model/dict/DictData.php +++ b/app/common/model/dict/DictData.php @@ -30,7 +30,8 @@ class DictData extends BaseModel protected $deleteTime = 'delete_time'; - + // 不生成该表的日志 + public $doNotRecordLog = true; /** * @notes 状态描述 * @param $value diff --git a/app/common/model/dict/DictType.php b/app/common/model/dict/DictType.php index 7b2be5060..8222af251 100644 --- a/app/common/model/dict/DictType.php +++ b/app/common/model/dict/DictType.php @@ -29,7 +29,8 @@ class DictType extends BaseModel use SoftDelete; protected $deleteTime = 'delete_time'; - + // 不生成该表的日志 + public $doNotRecordLog = true; /** * @notes 状态描述 diff --git a/app/common/model/distribution/Distribution.php b/app/common/model/distribution/Distribution.php index f63be4b9d..3553a2cb0 100644 --- a/app/common/model/distribution/Distribution.php +++ b/app/common/model/distribution/Distribution.php @@ -17,6 +17,7 @@ class Distribution extends BaseModel use SoftDelete; protected $name = 'distribution'; protected $deleteTime = 'delete_time'; - + // 不生成该表的日志 + public $doNotRecordLog = true; } \ No newline at end of file diff --git a/app/common/model/file/File.php b/app/common/model/file/File.php index 558b1188b..0181b2938 100644 --- a/app/common/model/file/File.php +++ b/app/common/model/file/File.php @@ -21,4 +21,6 @@ class File extends BaseModel { use SoftDelete; protected $deleteTime = 'delete_time'; -} \ No newline at end of file + // 不生成该表的日志 + public $doNotRecordLog = true; +} diff --git a/app/common/model/file/FileCate.php b/app/common/model/file/FileCate.php index 845904be7..52925f97a 100644 --- a/app/common/model/file/FileCate.php +++ b/app/common/model/file/FileCate.php @@ -22,4 +22,6 @@ class FileCate extends BaseModel { use SoftDelete; protected $deleteTime = 'delete_time'; -} \ No newline at end of file + // 不生成该表的日志 + public $doNotRecordLog = true; +} diff --git a/app/common/model/finance/CapitalFlow.php b/app/common/model/finance/CapitalFlow.php index c21929d67..da2ca34ad 100644 --- a/app/common/model/finance/CapitalFlow.php +++ b/app/common/model/finance/CapitalFlow.php @@ -9,5 +9,6 @@ class CapitalFlow extends BaseModel { use SoftDelete; protected $deleteTime = 'delete_time'; - + // 不生成该表的日志 + public $doNotRecordLog = true; } diff --git a/app/common/model/finance/PayNotifyLog.php b/app/common/model/finance/PayNotifyLog.php index 60ef81506..3ebda3db5 100644 --- a/app/common/model/finance/PayNotifyLog.php +++ b/app/common/model/finance/PayNotifyLog.php @@ -6,7 +6,8 @@ use app\common\model\BaseModel; class PayNotifyLog extends BaseModel { - + // 不生成该表的日志 + public $doNotRecordLog = true; const TYPE_ORDER = 1; const TYPE_REFUND = 2; diff --git a/app/common/model/financial_transfers/FinancialTransfers.php b/app/common/model/financial_transfers/FinancialTransfers.php index dede4d2f9..6fe2d1a2e 100644 --- a/app/common/model/financial_transfers/FinancialTransfers.php +++ b/app/common/model/financial_transfers/FinancialTransfers.php @@ -20,7 +20,8 @@ class FinancialTransfers extends BaseModel use SoftDelete; protected $name = 'financial_transfers'; protected $deleteTime = 'delete_time'; - + // 不生成该表的日志 + public $doNotRecordLog = true; public function store() { diff --git a/app/common/model/geo/GeoArea.php b/app/common/model/geo/GeoArea.php index cb0741e95..aa2e2d6ad 100644 --- a/app/common/model/geo/GeoArea.php +++ b/app/common/model/geo/GeoArea.php @@ -12,5 +12,6 @@ class GeoArea extends BaseModel { protected $name = 'geo_area'; - + // 不生成该表的日志 + public $doNotRecordLog = true; } \ No newline at end of file diff --git a/app/common/model/geo/GeoBrigade.php b/app/common/model/geo/GeoBrigade.php index ffaaeb986..4af8a4b17 100644 --- a/app/common/model/geo/GeoBrigade.php +++ b/app/common/model/geo/GeoBrigade.php @@ -12,5 +12,6 @@ class GeoBrigade extends BaseModel { protected $name = 'geo_brigade'; - + // 不生成该表的日志 + public $doNotRecordLog = true; } \ No newline at end of file diff --git a/app/common/model/geo/GeoCity.php b/app/common/model/geo/GeoCity.php index 64e27fe70..6db9fd791 100644 --- a/app/common/model/geo/GeoCity.php +++ b/app/common/model/geo/GeoCity.php @@ -12,5 +12,6 @@ class GeoCity extends BaseModel { protected $name = 'geo_city'; - + // 不生成该表的日志 + public $doNotRecordLog = true; } \ No newline at end of file diff --git a/app/common/model/geo/GeoProvince.php b/app/common/model/geo/GeoProvince.php index 899c23ef6..df20fdaae 100644 --- a/app/common/model/geo/GeoProvince.php +++ b/app/common/model/geo/GeoProvince.php @@ -12,5 +12,6 @@ class GeoProvince extends BaseModel { protected $name = 'geo_province'; - + // 不生成该表的日志 + public $doNotRecordLog = true; } \ No newline at end of file diff --git a/app/common/model/geo/GeoStreet.php b/app/common/model/geo/GeoStreet.php index 34387d21a..a5e24f434 100644 --- a/app/common/model/geo/GeoStreet.php +++ b/app/common/model/geo/GeoStreet.php @@ -12,5 +12,6 @@ class GeoStreet extends BaseModel { protected $name = 'geo_street'; - + // 不生成该表的日志 + public $doNotRecordLog = true; } \ No newline at end of file diff --git a/app/common/model/geo/GeoVillage.php b/app/common/model/geo/GeoVillage.php index 6daaf4745..26e300c59 100644 --- a/app/common/model/geo/GeoVillage.php +++ b/app/common/model/geo/GeoVillage.php @@ -12,5 +12,6 @@ class GeoVillage extends BaseModel { protected $name = 'geo_village'; - + // 不生成该表的日志 + public $doNotRecordLog = true; } \ No newline at end of file diff --git a/app/common/model/merchant/Merchant.php b/app/common/model/merchant/Merchant.php index 8e5314a05..ce8497e38 100644 --- a/app/common/model/merchant/Merchant.php +++ b/app/common/model/merchant/Merchant.php @@ -19,7 +19,8 @@ class Merchant extends BaseModel protected $ok = 'mer_id'; protected $name = 'merchant'; protected $deleteTime = 'delete_time'; - + // 不生成该表的日志 + public $doNotRecordLog = true; public function realName() { return $this->hasOne(User::class,'id','uid')->bind(['mer_real_name'=>'real_name']); diff --git a/app/common/model/order/Cart.php b/app/common/model/order/Cart.php index 58d592c61..dfaca1db1 100644 --- a/app/common/model/order/Cart.php +++ b/app/common/model/order/Cart.php @@ -17,6 +17,7 @@ class Cart extends BaseModel use SoftDelete; protected $name = 'store_cart'; protected $deleteTime = 'delete_time'; - + // 不生成该表的日志 + public $doNotRecordLog = true; } \ No newline at end of file diff --git a/app/common/model/pay/PayConfig.php b/app/common/model/pay/PayConfig.php index 4c1738d6e..6dffa9acb 100644 --- a/app/common/model/pay/PayConfig.php +++ b/app/common/model/pay/PayConfig.php @@ -11,7 +11,8 @@ use app\common\service\FileService; class PayConfig extends BaseModel { protected $name = 'dev_pay_config'; - + // 不生成该表的日志 + public $doNotRecordLog = true; // 设置json类型字段 protected $json = ['config']; diff --git a/app/common/model/pay/PayNotify.php b/app/common/model/pay/PayNotify.php index 44d3c4e38..455f8010c 100644 --- a/app/common/model/pay/PayNotify.php +++ b/app/common/model/pay/PayNotify.php @@ -7,4 +7,6 @@ use app\common\model\BaseModel; class PayNotify extends BaseModel { protected $name = 'pay_notify_log'; -} \ No newline at end of file + // 不生成该表的日志 + public $doNotRecordLog = true; +} diff --git a/app/common/model/pay/PayWay.php b/app/common/model/pay/PayWay.php index 1f21910cd..c90a8b546 100644 --- a/app/common/model/pay/PayWay.php +++ b/app/common/model/pay/PayWay.php @@ -22,7 +22,8 @@ use app\common\service\FileService; class PayWay extends BaseModel { protected $name = 'dev_pay_way'; - + // 不生成该表的日志 + public $doNotRecordLog = true; public function getIconAttr($value,$data) { return FileService::getFileUrl($value); diff --git a/app/common/model/purchase_order/PurchaseOrder.php b/app/common/model/purchase_order/PurchaseOrder.php index b0bb36cb1..d109d426e 100644 --- a/app/common/model/purchase_order/PurchaseOrder.php +++ b/app/common/model/purchase_order/PurchaseOrder.php @@ -17,6 +17,7 @@ class PurchaseOrder extends BaseModel use SoftDelete; protected $name = 'purchase_order'; protected $deleteTime = 'delete_time'; - protected $json = ['order_arr','store_arr']; - -} \ No newline at end of file + protected $json = ['order_arr', 'store_arr']; + // 不生成该表的日志 + public $doNotRecordLog = true; +} diff --git a/app/common/model/purchase_order_info/PurchaseOrderInfo.php b/app/common/model/purchase_order_info/PurchaseOrderInfo.php index 1d549d70b..a4baa0256 100644 --- a/app/common/model/purchase_order_info/PurchaseOrderInfo.php +++ b/app/common/model/purchase_order_info/PurchaseOrderInfo.php @@ -17,6 +17,7 @@ class PurchaseOrderInfo extends BaseModel use SoftDelete; protected $name = 'purchase_order_info'; protected $deleteTime = 'delete_time'; - + // 不生成该表的日志 + public $doNotRecordLog = true; } \ No newline at end of file diff --git a/app/common/model/purchase_product_offer/PurchaseProductOffer.php b/app/common/model/purchase_product_offer/PurchaseProductOffer.php index 54b111504..2c15941b4 100644 --- a/app/common/model/purchase_product_offer/PurchaseProductOffer.php +++ b/app/common/model/purchase_product_offer/PurchaseProductOffer.php @@ -18,7 +18,8 @@ class PurchaseProductOffer extends BaseModel use SoftDelete; protected $name = 'purchase_product_offer'; protected $deleteTime = 'delete_time'; - + // 不生成该表的日志 + public $doNotRecordLog = true; protected $json = ['source_order_info']; protected $jsonAssoc = true; diff --git a/app/common/model/setting/Category.php b/app/common/model/setting/Category.php index eae9f2546..67fabab8e 100644 --- a/app/common/model/setting/Category.php +++ b/app/common/model/setting/Category.php @@ -17,6 +17,7 @@ class Category extends BaseModel use SoftDelete; protected $name = 'category'; protected $deleteTime = 'delete_time'; - + // 不生成该表的日志 + public $doNotRecordLog = true; } \ No newline at end of file diff --git a/app/common/model/store_branch_product_attr_value/StoreBranchProductAttrValue.php b/app/common/model/store_branch_product_attr_value/StoreBranchProductAttrValue.php index bd44c55e6..472e343e4 100644 --- a/app/common/model/store_branch_product_attr_value/StoreBranchProductAttrValue.php +++ b/app/common/model/store_branch_product_attr_value/StoreBranchProductAttrValue.php @@ -19,7 +19,8 @@ class StoreBranchProductAttrValue extends BaseModel use SoftDelete; protected $name = 'store_branch_product_attr_value'; protected $deleteTime = 'delete_time'; - + // 不生成该表的日志 + public $doNotRecordLog = true; public function attr() { return $this->hasOne(StoreBranchProduct::class, 'product_id', 'product_id')->bind(['image']); diff --git a/app/common/model/store_branch_product_exchange/StoreBranchProductExchange.php b/app/common/model/store_branch_product_exchange/StoreBranchProductExchange.php index 24ad4cbc3..6f1d39b69 100644 --- a/app/common/model/store_branch_product_exchange/StoreBranchProductExchange.php +++ b/app/common/model/store_branch_product_exchange/StoreBranchProductExchange.php @@ -20,5 +20,6 @@ class StoreBranchProductExchange extends BaseModel use SoftDelete; protected $name = 'store_branch_product_exchange'; protected $deleteTime = 'delete_time'; - + // 不生成该表的日志 + public $doNotRecordLog = true; } \ No newline at end of file diff --git a/app/common/model/store_cash_finance_flow/StoreCashFinanceFlow.php b/app/common/model/store_cash_finance_flow/StoreCashFinanceFlow.php index 9f41f7ee0..5e5b542d2 100644 --- a/app/common/model/store_cash_finance_flow/StoreCashFinanceFlow.php +++ b/app/common/model/store_cash_finance_flow/StoreCashFinanceFlow.php @@ -18,5 +18,6 @@ class StoreCashFinanceFlow extends BaseModel protected $name = 'store_cash_finance_flow'; protected $deleteTime = 'delete_time'; - -} \ No newline at end of file + // 不生成该表的日志 + public $doNotRecordLog = true; +} diff --git a/app/common/model/store_category/StoreCategory.php b/app/common/model/store_category/StoreCategory.php index 27b4d9e54..c1d037935 100644 --- a/app/common/model/store_category/StoreCategory.php +++ b/app/common/model/store_category/StoreCategory.php @@ -21,5 +21,6 @@ class StoreCategory extends BaseModel protected $json = ['price_rate']; protected $jsonAssoc = true; - -} \ No newline at end of file + // 不生成该表的日志 + public $doNotRecordLog = true; +} diff --git a/app/common/model/store_extract/StoreExtract.php b/app/common/model/store_extract/StoreExtract.php index c34325ef2..b21dbeceb 100644 --- a/app/common/model/store_extract/StoreExtract.php +++ b/app/common/model/store_extract/StoreExtract.php @@ -17,6 +17,7 @@ class StoreExtract extends BaseModel use SoftDelete; protected $name = 'store_extract'; protected $deleteTime = 'delete_time'; - + // 不生成该表的日志 + public $doNotRecordLog = true; } \ No newline at end of file diff --git a/app/common/model/store_finance_flow/StoreFinanceFlow.php b/app/common/model/store_finance_flow/StoreFinanceFlow.php index c1e701280..4edae4f64 100644 --- a/app/common/model/store_finance_flow/StoreFinanceFlow.php +++ b/app/common/model/store_finance_flow/StoreFinanceFlow.php @@ -21,7 +21,8 @@ class StoreFinanceFlow extends BaseModel use SoftDelete; protected $name = 'store_finance_flow'; protected $deleteTime = 'delete_time'; - + // 不生成该表的日志 + public $doNotRecordLog = true; public function store() { return $this->hasOne(SystemStore::class, 'id','store_id') diff --git a/app/common/model/store_finance_flow_product/StoreFinanceFlowProduct.php b/app/common/model/store_finance_flow_product/StoreFinanceFlowProduct.php index daa72cf84..ae371d467 100644 --- a/app/common/model/store_finance_flow_product/StoreFinanceFlowProduct.php +++ b/app/common/model/store_finance_flow_product/StoreFinanceFlowProduct.php @@ -18,4 +18,6 @@ class StoreFinanceFlowProduct extends BaseModel use SoftDelete; protected $name = 'store_finance_flow_product'; protected $deleteTime = 'delete_time'; -} \ No newline at end of file + // 不生成该表的日志 + public $doNotRecordLog = true; +} diff --git a/app/common/model/store_order/StoreOrder.php b/app/common/model/store_order/StoreOrder.php index e373c780f..23923415a 100644 --- a/app/common/model/store_order/StoreOrder.php +++ b/app/common/model/store_order/StoreOrder.php @@ -23,6 +23,8 @@ class StoreOrder extends BaseModel use SoftDelete; protected $name = 'store_order'; protected $deleteTime = 'delete_time'; + // 不生成该表的日志 + public $doNotRecordLog = true; // public function getPayTimeAttr($value) // { // return $value?date('Y-m-d H:i:s', $value):''; @@ -40,9 +42,9 @@ class StoreOrder extends BaseModel } public function getSystemStoreNameTextAttr($value, $data) { - if($data['store_id']>0){ - $name = SystemStore::where('id',$data['store_id'])->value('name'); - }else{ + if ($data['store_id'] > 0) { + $name = SystemStore::where('id', $data['store_id'])->value('name'); + } else { $name = '无'; } return $name; @@ -50,9 +52,9 @@ class StoreOrder extends BaseModel public function getStatusNameTextAttr($value, $data) { - if($data['status']==-1){ + if ($data['status'] == -1) { $status = OrderEnum::refundStatus($data['refund_status']) ?? ''; - }else{ + } else { $status = OrderEnum::getOrderType($data['status']) ?? ''; } return $status; @@ -72,7 +74,7 @@ class StoreOrder extends BaseModel { return $this->hasOne(SystemStoreStaff::class, 'id', 'staff_id')->bind(['staff_name']); } - /** + /** * 总销售额 * @param $time * @return float @@ -92,7 +94,7 @@ class StoreOrder extends BaseModel { return $this->where($where)->where('paid', 1)->where('refund_status', '=', 0)->where(function ($query) use ($time) { if ($time[0] == $time[1]) { - $query->whereDay('create_time', date('Y-m-d',$time[0])); + $query->whereDay('create_time', date('Y-m-d', $time[0])); } else { $time[1] = $time[1] + 86400; $query->whereTime('create_time', 'between', $time); @@ -105,10 +107,10 @@ class StoreOrder extends BaseModel { try { $where = $data->getWhere(); - if($data){ + if ($data) { $find = self::where($where)->field(array_keys($data->toArray()))->find(); - if($find){ - channelLog(array_merge($find->toArray(), $where),'store_order','更新前'); + if ($find) { + channelLog(array_merge($find->toArray(), $where), 'store_order', '更新前'); } } } catch (Throwable $e) { @@ -116,11 +118,12 @@ class StoreOrder extends BaseModel } } - public static function onAfterWrite($data){ - try{ - channelLog($data->toArray(),'store_order','更新后'); - }catch(Throwable $e){ - Log::error('store_order:更新后'.$e->getMessage()); + public static function onAfterWrite($data) + { + try { + channelLog($data->toArray(), 'store_order', '更新后'); + } catch (Throwable $e) { + Log::error('store_order:更新后' . $e->getMessage()); } } } diff --git a/app/common/model/store_order_cart_info/StoreOrderCartInfo.php b/app/common/model/store_order_cart_info/StoreOrderCartInfo.php index a3c407b10..92f8155bd 100644 --- a/app/common/model/store_order_cart_info/StoreOrderCartInfo.php +++ b/app/common/model/store_order_cart_info/StoreOrderCartInfo.php @@ -15,7 +15,8 @@ class StoreOrderCartInfo extends BaseModel protected $deleteTime = 'delete_time'; protected $json = ['cart_info']; protected $jsonAssoc = true; - + // 不生成该表的日志 + public $doNotRecordLog = true; public function goodsName() { return $this->hasOne(StoreBranchProduct::class,'id','product_id')->bind(['store_name','image','unit','price']); diff --git a/app/common/model/store_order_transshipment_info/StoreOrderTransshipmentInfo.php b/app/common/model/store_order_transshipment_info/StoreOrderTransshipmentInfo.php index 9425a05e6..5bf7bb3b4 100644 --- a/app/common/model/store_order_transshipment_info/StoreOrderTransshipmentInfo.php +++ b/app/common/model/store_order_transshipment_info/StoreOrderTransshipmentInfo.php @@ -16,7 +16,5 @@ class StoreOrderTransshipmentInfo extends BaseModel { use SoftDelete; protected $name = 'store_order_transshipment_info'; - protected $deleteTime = 'delete_time'; - - + protected $deleteTime = 'delete_time'; } \ No newline at end of file diff --git a/app/common/model/store_product_attr_value/StoreProductAttrValue.php b/app/common/model/store_product_attr_value/StoreProductAttrValue.php index 0cf33aa73..7023f42fd 100644 --- a/app/common/model/store_product_attr_value/StoreProductAttrValue.php +++ b/app/common/model/store_product_attr_value/StoreProductAttrValue.php @@ -18,7 +18,8 @@ class StoreProductAttrValue extends BaseModel use SoftDelete; protected $name = 'store_product_attr_value'; protected $deleteTime = 'delete_time'; - + // 不生成该表的日志 + public $doNotRecordLog = true; public function storeName() { return $this->belongsTo(StoreProduct::class, 'product_id', 'id') diff --git a/app/common/model/store_product_cate/StoreProductCate.php b/app/common/model/store_product_cate/StoreProductCate.php index 41338c9e7..1e4abd3df 100644 --- a/app/common/model/store_product_cate/StoreProductCate.php +++ b/app/common/model/store_product_cate/StoreProductCate.php @@ -10,5 +10,6 @@ class StoreProductCate extends BaseModel use SoftDelete; protected $name = 'store_product_cate'; protected $deleteTime = 'delete_time'; - + // 不生成该表的日志 + public $doNotRecordLog = true; } \ No newline at end of file diff --git a/app/common/model/store_product_gift/StoreProductGift.php b/app/common/model/store_product_gift/StoreProductGift.php index a4e1c07a1..92d333696 100644 --- a/app/common/model/store_product_gift/StoreProductGift.php +++ b/app/common/model/store_product_gift/StoreProductGift.php @@ -14,7 +14,8 @@ class StoreProductGift extends BaseModel use SoftDelete; protected $name = 'store_product_gift'; protected $deleteTime = 'delete_time'; - + // 不生成该表的日志 + public $doNotRecordLog = true; public function store() { return $this->hasOne(SystemStore::class, 'id', 'store_id') diff --git a/app/common/model/store_product_group_price/StoreProductGroupPrice.php b/app/common/model/store_product_group_price/StoreProductGroupPrice.php index b6b4e0fe0..c587e1e84 100644 --- a/app/common/model/store_product_group_price/StoreProductGroupPrice.php +++ b/app/common/model/store_product_group_price/StoreProductGroupPrice.php @@ -17,7 +17,8 @@ class StoreProductGroupPrice extends BaseModel use SoftDelete; protected $name = 'store_product_group_price'; protected $deleteTime = 'delete_time'; - + // 不生成该表的日志 + public $doNotRecordLog = true; public static function resetProductsPrice($productList, $userShip) { $productIds = array_column($productList, 'product_id'); diff --git a/app/common/model/store_product_log/StoreProductLog.php b/app/common/model/store_product_log/StoreProductLog.php index 6c17971e3..6b6795a6e 100644 --- a/app/common/model/store_product_log/StoreProductLog.php +++ b/app/common/model/store_product_log/StoreProductLog.php @@ -18,7 +18,8 @@ class StoreProductLog extends BaseModel use SoftDelete; protected $name = 'store_product_log'; protected $deleteTime = 'delete_time'; - + // 不生成该表的日志 + public $doNotRecordLog = true; public function store() { return $this->hasOne(SystemStore::class, 'id', 'store_id') diff --git a/app/common/model/store_product_price/StoreProductPrice.php b/app/common/model/store_product_price/StoreProductPrice.php index 92e9bed1b..de32abc9d 100644 --- a/app/common/model/store_product_price/StoreProductPrice.php +++ b/app/common/model/store_product_price/StoreProductPrice.php @@ -20,5 +20,6 @@ class StoreProductPrice extends BaseModel protected $json = ['price_config']; protected $jsonAssoc = true; - + // 不生成该表的日志 + public $doNotRecordLog = true; } \ No newline at end of file diff --git a/app/common/model/store_product_unit/StoreProductUnit.php b/app/common/model/store_product_unit/StoreProductUnit.php index 508a978ca..25ae5418e 100644 --- a/app/common/model/store_product_unit/StoreProductUnit.php +++ b/app/common/model/store_product_unit/StoreProductUnit.php @@ -17,6 +17,7 @@ class StoreProductUnit extends BaseModel use SoftDelete; protected $name = 'store_product_unit'; protected $deleteTime = 'delete_time'; - + // 不生成该表的日志 + public $doNotRecordLog = true; } \ No newline at end of file diff --git a/app/common/model/store_visit/StoreVisit.php b/app/common/model/store_visit/StoreVisit.php index 82a837d8f..2ae8a40a2 100644 --- a/app/common/model/store_visit/StoreVisit.php +++ b/app/common/model/store_visit/StoreVisit.php @@ -17,6 +17,7 @@ class StoreVisit extends BaseModel use SoftDelete; protected $name = 'store_visit'; protected $deleteTime = 'delete_time'; - + // 不生成该表的日志 + public $doNotRecordLog = true; } \ No newline at end of file diff --git a/app/common/model/supplier/Supplier.php b/app/common/model/supplier/Supplier.php index e6d9d9a38..94a21edf6 100644 --- a/app/common/model/supplier/Supplier.php +++ b/app/common/model/supplier/Supplier.php @@ -17,6 +17,7 @@ class Supplier extends BaseModel use SoftDelete; protected $name = 'supplier'; protected $deleteTime = 'delete_time'; - + // 不生成该表的日志 + public $doNotRecordLog = true; } \ No newline at end of file diff --git a/app/common/model/system_store/DeliveryService.php b/app/common/model/system_store/DeliveryService.php index 51a7b5f19..530c4c2ed 100644 --- a/app/common/model/system_store/DeliveryService.php +++ b/app/common/model/system_store/DeliveryService.php @@ -17,7 +17,8 @@ class DeliveryService extends BaseModel protected $name = 'delivery_service'; protected $deleteTime = 'delete_time'; - + // 不生成该表的日志 + public $doNotRecordLog = true; /** * @notes 头像获取器 - 头像路径添加域名 * @param $value diff --git a/app/common/model/system_store/SystemStore.php b/app/common/model/system_store/SystemStore.php index 320d93f30..f950d4e56 100644 --- a/app/common/model/system_store/SystemStore.php +++ b/app/common/model/system_store/SystemStore.php @@ -18,7 +18,8 @@ class SystemStore extends BaseModel use SoftDelete; protected $name = 'system_store'; protected $deleteTime = 'delete_time'; - + // 不生成该表的日志 + public $doNotRecordLog = true; public static function onBeforeWrite($data) { try { diff --git a/app/common/model/system_store/SystemStoreMenu.php b/app/common/model/system_store/SystemStoreMenu.php index d1ecfcc07..cf11a0e86 100644 --- a/app/common/model/system_store/SystemStoreMenu.php +++ b/app/common/model/system_store/SystemStoreMenu.php @@ -28,6 +28,7 @@ class SystemStoreMenu extends BaseModel { use SoftDelete; protected $deleteTime = 'delete_time'; - + // 不生成该表的日志 + public $doNotRecordLog = true; } diff --git a/app/common/model/system_store/SystemStoreStaff.php b/app/common/model/system_store/SystemStoreStaff.php index d6919b59a..7bf31ccba 100644 --- a/app/common/model/system_store/SystemStoreStaff.php +++ b/app/common/model/system_store/SystemStoreStaff.php @@ -18,7 +18,8 @@ class SystemStoreStaff extends BaseModel use SoftDelete; protected $name = 'system_store_staff'; protected $deleteTime = 'delete_time'; - + // 不生成该表的日志 + public $doNotRecordLog = true; /** * @notes 头像获取器 - 头像路径添加域名 * @param $value diff --git a/app/common/model/system_store/SystemStoreStaffSession.php b/app/common/model/system_store/SystemStoreStaffSession.php index ad2c073f2..1c3a52302 100644 --- a/app/common/model/system_store/SystemStoreStaffSession.php +++ b/app/common/model/system_store/SystemStoreStaffSession.php @@ -10,5 +10,6 @@ class SystemStoreStaffSession extends BaseModel protected $name = 'system_store_staff_session'; protected $createTime = false; - + // 不生成该表的日志 + public $doNotRecordLog = true; } diff --git a/app/common/model/tools/GenerateColumn.php b/app/common/model/tools/GenerateColumn.php index 7426cc753..2fdeeef07 100644 --- a/app/common/model/tools/GenerateColumn.php +++ b/app/common/model/tools/GenerateColumn.php @@ -25,7 +25,8 @@ use app\common\model\BaseModel; */ class GenerateColumn extends BaseModel { - + // 不生成该表的日志 + public $doNotRecordLog = true; /** * @notes 关联table表 * @return \think\model\relation\BelongsTo diff --git a/app/common/model/tools/GenerateTable.php b/app/common/model/tools/GenerateTable.php index 181bbe4fc..c2fddd6b2 100644 --- a/app/common/model/tools/GenerateTable.php +++ b/app/common/model/tools/GenerateTable.php @@ -29,7 +29,8 @@ class GenerateTable extends BaseModel protected $json = ['menu', 'tree', 'relations', 'delete']; protected $jsonAssoc = true; - + // 不生成该表的日志 + public $doNotRecordLog = true; /** * @notes 关联数据表字段 * @return \think\model\relation\HasMany diff --git a/app/common/model/user/User.php b/app/common/model/user/User.php index 78c226694..4b0faba4f 100644 --- a/app/common/model/user/User.php +++ b/app/common/model/user/User.php @@ -23,7 +23,8 @@ class User extends BaseModel use SoftDelete; protected $deleteTime = 'delete_time'; - + // 不生成该表的日志 + public $doNotRecordLog = true; //会员类型 public function userShip() { diff --git a/app/common/model/user/UserAddress.php b/app/common/model/user/UserAddress.php index a052e22d2..be42fe2aa 100644 --- a/app/common/model/user/UserAddress.php +++ b/app/common/model/user/UserAddress.php @@ -22,7 +22,8 @@ class UserAddress extends BaseModel protected $pk = 'id'; protected $deleteTime = 'delete_time'; - + // 不生成该表的日志 + public $doNotRecordLog = true; public static function getDefaultAddress($uid) { $address = self::with(['area', 'street', 'village', 'brigade'])->where(['uid' => $uid, 'is_default' => 1])->find(); diff --git a/app/common/model/user/UserAuth.php b/app/common/model/user/UserAuth.php index bbc719ae9..37ac6c1d4 100644 --- a/app/common/model/user/UserAuth.php +++ b/app/common/model/user/UserAuth.php @@ -13,5 +13,6 @@ use app\common\model\BaseModel; */ class UserAuth extends BaseModel { - + // 不生成该表的日志 + public $doNotRecordLog = true; } \ No newline at end of file diff --git a/app/common/model/user/UserFeedback.php b/app/common/model/user/UserFeedback.php index 14e24f431..c67c35ae3 100644 --- a/app/common/model/user/UserFeedback.php +++ b/app/common/model/user/UserFeedback.php @@ -17,7 +17,8 @@ class UserFeedback extends BaseModel use SoftDelete; protected $name = 'user_feedback'; protected $deleteTime = 'delete_time'; - + // 不生成该表的日志 + public $doNotRecordLog = true; public function getImagesAttr($value){ return !empty($value) ? json_decode($value,true) : ''; } diff --git a/app/common/model/user/UserRecharge.php b/app/common/model/user/UserRecharge.php index 7876c81f9..1d81126b6 100644 --- a/app/common/model/user/UserRecharge.php +++ b/app/common/model/user/UserRecharge.php @@ -17,5 +17,6 @@ class UserRecharge extends BaseModel use SoftDelete; protected $pk = 'id'; protected $deleteTime = 'delete_time'; - + // 不生成该表的日志 + public $doNotRecordLog = true; } \ No newline at end of file diff --git a/app/common/model/user/UserSession.php b/app/common/model/user/UserSession.php index 7685fb568..a7a83a449 100644 --- a/app/common/model/user/UserSession.php +++ b/app/common/model/user/UserSession.php @@ -11,5 +11,6 @@ use app\common\model\BaseModel; */ class UserSession extends BaseModel { - + // 不生成该表的日志 + public $doNotRecordLog = true; } \ No newline at end of file diff --git a/app/common/model/user/UserVisit.php b/app/common/model/user/UserVisit.php index 182247e34..ced21db44 100644 --- a/app/common/model/user/UserVisit.php +++ b/app/common/model/user/UserVisit.php @@ -18,7 +18,8 @@ class UserVisit extends BaseModel protected $pk = 'id'; protected $deleteTime = 'delete_time'; - + // 不生成该表的日志 + public $doNotRecordLog = true; /** * 用户趋势数据 * @param $time diff --git a/app/common/model/user_bill/UserBill.php b/app/common/model/user_bill/UserBill.php index e548b068f..7dca8484d 100644 --- a/app/common/model/user_bill/UserBill.php +++ b/app/common/model/user_bill/UserBill.php @@ -17,6 +17,7 @@ class UserBill extends BaseModel use SoftDelete; protected $name = 'user_bill'; protected $deleteTime = 'delete_time'; - + // 不生成该表的日志 + public $doNotRecordLog = true; } \ No newline at end of file diff --git a/app/common/model/user_create_log/UserCreateLog.php b/app/common/model/user_create_log/UserCreateLog.php index f323d5625..5dea70fa5 100644 --- a/app/common/model/user_create_log/UserCreateLog.php +++ b/app/common/model/user_create_log/UserCreateLog.php @@ -17,6 +17,7 @@ class UserCreateLog extends BaseModel use SoftDelete; protected $name = 'user_create_log'; protected $deleteTime = 'delete_time'; - + // 不生成该表的日志 + public $doNotRecordLog = true; } \ No newline at end of file diff --git a/app/common/model/user_label/UserLabel.php b/app/common/model/user_label/UserLabel.php index adeb03be2..469631818 100644 --- a/app/common/model/user_label/UserLabel.php +++ b/app/common/model/user_label/UserLabel.php @@ -17,6 +17,7 @@ class UserLabel extends BaseModel use SoftDelete; protected $name = 'user_label'; protected $deleteTime = 'delete_time'; - + // 不生成该表的日志 + public $doNotRecordLog = true; } \ No newline at end of file diff --git a/app/common/model/user_product_storage/UserProductStorage.php b/app/common/model/user_product_storage/UserProductStorage.php index 32b16daac..b36b932e8 100644 --- a/app/common/model/user_product_storage/UserProductStorage.php +++ b/app/common/model/user_product_storage/UserProductStorage.php @@ -17,4 +17,6 @@ class UserProductStorage extends BaseModel use SoftDelete; protected $name = 'user_product_storage'; protected $deleteTime = 'delete_time'; -} \ No newline at end of file + // 不生成该表的日志 + public $doNotRecordLog = true; +} diff --git a/app/common/model/user_product_storage_log/UserProductStorageLog.php b/app/common/model/user_product_storage_log/UserProductStorageLog.php index a7f2558e7..898931726 100644 --- a/app/common/model/user_product_storage_log/UserProductStorageLog.php +++ b/app/common/model/user_product_storage_log/UserProductStorageLog.php @@ -16,5 +16,7 @@ class UserProductStorageLog extends BaseModel { use SoftDelete; protected $name = 'user_product_storage_log'; - protected $deleteTime = 'delete_time'; -} \ No newline at end of file + protected $deleteTime = 'delete_time'; + // 不生成该表的日志 + public $doNotRecordLog = true; +} diff --git a/app/common/model/user_recharge/UserRecharge.php b/app/common/model/user_recharge/UserRecharge.php index ce77b733f..2dc8b8899 100644 --- a/app/common/model/user_recharge/UserRecharge.php +++ b/app/common/model/user_recharge/UserRecharge.php @@ -17,7 +17,8 @@ class UserRecharge extends BaseModel use SoftDelete; protected $name = 'user_recharge'; protected $deleteTime = 'delete_time'; - + // 不生成该表的日志 + public $doNotRecordLog = true; /** * 获取充值统计曲线 * @param $time diff --git a/app/common/model/user_ship/UserShip.php b/app/common/model/user_ship/UserShip.php index 1cfc60f27..227a9ba97 100644 --- a/app/common/model/user_ship/UserShip.php +++ b/app/common/model/user_ship/UserShip.php @@ -10,4 +10,6 @@ class UserShip extends BaseModel use SoftDelete; protected $name = 'user_ship'; protected $deleteTime = 'delete_time'; -} \ No newline at end of file + // 不生成该表的日志 + public $doNotRecordLog = true; +} diff --git a/app/common/model/user_sign/UserSign.php b/app/common/model/user_sign/UserSign.php index 1efaea526..60132555d 100644 --- a/app/common/model/user_sign/UserSign.php +++ b/app/common/model/user_sign/UserSign.php @@ -17,5 +17,6 @@ class UserSign extends BaseModel use SoftDelete; protected $name = 'user_sign'; protected $deleteTime = 'delete_time'; - + // 不生成该表的日志 + public $doNotRecordLog = true; } \ No newline at end of file diff --git a/app/common/model/user_sign_log/UserSignLog.php b/app/common/model/user_sign_log/UserSignLog.php index 253b31a46..301548ebe 100644 --- a/app/common/model/user_sign_log/UserSignLog.php +++ b/app/common/model/user_sign_log/UserSignLog.php @@ -17,5 +17,6 @@ class UserSignLog extends BaseModel use SoftDelete; protected $name = 'user_sign_log'; protected $deleteTime = 'delete_time'; - + // 不生成该表的日志 + public $doNotRecordLog = true; } \ No newline at end of file diff --git a/app/common/model/user_spread_log/UserSpreadLog.php b/app/common/model/user_spread_log/UserSpreadLog.php index 6ac54de19..8204f8aa1 100644 --- a/app/common/model/user_spread_log/UserSpreadLog.php +++ b/app/common/model/user_spread_log/UserSpreadLog.php @@ -17,6 +17,7 @@ class UserSpreadLog extends BaseModel use SoftDelete; protected $name = 'user_spread_log'; protected $deleteTime = 'delete_time'; - + // 不生成该表的日志 + public $doNotRecordLog = true; } \ No newline at end of file diff --git a/app/common/model/vip_flow/VipFlow.php b/app/common/model/vip_flow/VipFlow.php index 9c62aa874..b1f934cea 100644 --- a/app/common/model/vip_flow/VipFlow.php +++ b/app/common/model/vip_flow/VipFlow.php @@ -11,7 +11,8 @@ class VipFlow extends BaseModel use SoftDelete; protected $name = 'vip_flow'; protected $deleteTime = 'delete_time'; - + // 不生成该表的日志 + public $doNotRecordLog = true; public function store() { return $this->hasOne(SystemStore::class, 'id','store_id') diff --git a/app/common/model/warehouse/Warehouse.php b/app/common/model/warehouse/Warehouse.php index 4689aefac..efc2c30e2 100644 --- a/app/common/model/warehouse/Warehouse.php +++ b/app/common/model/warehouse/Warehouse.php @@ -17,6 +17,7 @@ class Warehouse extends BaseModel use SoftDelete; protected $name = 'warehouse'; protected $deleteTime = 'delete_time'; - + // 不生成该表的日志 + public $doNotRecordLog = true; } \ No newline at end of file diff --git a/app/common/model/warehouse_order/WarehouseOrder.php b/app/common/model/warehouse_order/WarehouseOrder.php index 95f922c52..0b516e5a3 100644 --- a/app/common/model/warehouse_order/WarehouseOrder.php +++ b/app/common/model/warehouse_order/WarehouseOrder.php @@ -17,6 +17,7 @@ class WarehouseOrder extends BaseModel use SoftDelete; protected $name = 'warehouse_order'; protected $deleteTime = 'delete_time'; - + // 不生成该表的日志 + public $doNotRecordLog = true; } \ No newline at end of file diff --git a/app/common/model/warehouse_product_return/WarehouseProductReturn.php b/app/common/model/warehouse_product_return/WarehouseProductReturn.php index 9430486e9..b3002b238 100644 --- a/app/common/model/warehouse_product_return/WarehouseProductReturn.php +++ b/app/common/model/warehouse_product_return/WarehouseProductReturn.php @@ -17,6 +17,4 @@ class WarehouseProductReturn extends BaseModel use SoftDelete; protected $name = 'warehouse_product_return'; protected $deleteTime = 'delete_time'; - - } \ No newline at end of file