فهرست منبع

日志自动化完善

LD 5 سال پیش
والد
کامیت
403dbbd738
100فایلهای تغییر یافته به همراه487 افزوده شده و 82 حذف شده
  1. 4 0
      app/AuditLog.php
  2. 4 0
      app/Authority.php
  3. 4 0
      app/Batch.php
  4. 4 0
      app/CarType.php
  5. 4 0
      app/Carrier.php
  6. 4 0
      app/City.php
  7. 4 0
      app/Commodity.php
  8. 4 0
      app/CommodityBarcode.php
  9. 4 0
      app/Console/Commands/stubs/model.stub
  10. 4 0
      app/CustomField.php
  11. 4 0
      app/Customer.php
  12. 4 0
      app/CustomerLog.php
  13. 4 0
      app/CustomerLogStatus.php
  14. 4 0
      app/CustomerTag.php
  15. 4 0
      app/Depository.php
  16. 29 0
      app/Events/ModelChangedEvent.php
  17. 1 1
      app/Exceptions/Exception.php
  18. 24 20
      app/Exceptions/Handler.php
  19. 4 0
      app/Feature.php
  20. 1 1
      app/Http/Controllers/TestController.php
  21. 4 0
      app/Http/Kernel.php
  22. 27 0
      app/Http/Middleware/LogPostRequest.php
  23. 0 11
      app/Http/Requests/ForeignHaiRobotic_taskUpdateRequest.php
  24. 4 0
      app/InventoryAccount.php
  25. 4 0
      app/InventoryAccountMission.php
  26. 4 0
      app/InventoryBlindReceiveExcel.php
  27. 4 0
      app/InventoryCompare.php
  28. 4 0
      app/InventoryDailyLog.php
  29. 4 0
      app/InventoryDailyLoggingOwner.php
  30. 4 0
      app/JobType.php
  31. 4 0
      app/LaborCompany.php
  32. 4 0
      app/LaborReport.php
  33. 4 0
      app/LaborReportStatus.php
  34. 32 0
      app/Listeners/ModelChangedListener.php
  35. 3 1
      app/Log.php
  36. 4 0
      app/Logistic.php
  37. 4 0
      app/LogisticNumberFeature.php
  38. 4 0
      app/LogisticTiming.php
  39. 4 0
      app/MaterialBox.php
  40. 4 0
      app/MeasuringMachine.php
  41. 4 0
      app/Menu.php
  42. 0 47
      app/ModelExtended.php
  43. 4 0
      app/OperatorLog.php
  44. 4 0
      app/OracleActAllocationDetails.php
  45. 4 0
      app/OracleActTransactionLog.php
  46. 4 0
      app/OracleBasCode.php
  47. 4 0
      app/OracleBasCustomer.php
  48. 4 0
      app/OracleBasSKU.php
  49. 4 0
      app/OracleDOCASNDetail.php
  50. 4 0
      app/OracleDOCASNHeader.php
  51. 4 0
      app/OracleDOCMovementDetail.php
  52. 4 0
      app/OracleDOCMovementHeader.php
  53. 4 0
      app/OracleDOCOrderDetail.php
  54. 4 0
      app/OracleDOCOrderHeader.php
  55. 4 0
      app/OracleDOCWaveDetails.php
  56. 4 0
      app/OracleDOCWaveHeader.php
  57. 4 0
      app/OracleDocOrderPackingSummary.php
  58. 4 0
      app/OracleIdxAsrsReceive.php
  59. 9 1
      app/OracleInvLotAtt.php
  60. 4 0
      app/OracleInvLotLocId.php
  61. 4 0
      app/Order.php
  62. 4 0
      app/OrderBin.php
  63. 4 0
      app/OrderCommodity.php
  64. 4 0
      app/OrderCommodityAssign.php
  65. 4 0
      app/OrderCountingRecord.php
  66. 4 0
      app/OrderIssue.php
  67. 4 0
      app/OrderIssueOnTop.php
  68. 4 0
      app/OrderIssueProcessLog.php
  69. 4 0
      app/OrderIssueType.php
  70. 4 0
      app/OrderPackage.php
  71. 4 0
      app/OrderPackageCommodities.php
  72. 4 0
      app/OrderTracking.php
  73. 4 0
      app/OrderTrackingOwner.php
  74. 4 0
      app/Owner.php
  75. 4 0
      app/OwnerAreaReport.php
  76. 4 0
      app/OwnerBillReport.php
  77. 4 0
      app/OwnerContract.php
  78. 4 0
      app/OwnerFeeDetail.php
  79. 4 0
      app/OwnerInStorageRule.php
  80. 4 0
      app/OwnerOutStorageRule.php
  81. 4 0
      app/OwnerPriceDirectLogistic.php
  82. 4 0
      app/OwnerPriceDirectLogisticCar.php
  83. 4 0
      app/OwnerPriceExpress.php
  84. 4 0
      app/OwnerPriceExpressProvince.php
  85. 4 0
      app/OwnerPriceLogistic.php
  86. 4 0
      app/OwnerPriceLogisticDetail.php
  87. 4 0
      app/OwnerPriceOperation.php
  88. 4 0
      app/OwnerReport.php
  89. 4 0
      app/OwnerStoragePriceModel.php
  90. 4 0
      app/OwnerStoragePriceModelOwner.php
  91. 4 0
      app/Package.php
  92. 4 0
      app/PaperBox.php
  93. 4 0
      app/Process.php
  94. 4 0
      app/ProcessDaily.php
  95. 4 0
      app/ProcessDailyParticipant.php
  96. 4 0
      app/ProcessMethod.php
  97. 4 0
      app/ProcessStatistic.php
  98. 4 0
      app/ProcessesContent.php
  99. 5 0
      app/Providers/EventServiceProvider.php
  100. 4 0
      app/Province.php

+ 4 - 0
app/AuditLog.php

@@ -6,8 +6,12 @@ use Illuminate\Database\Eloquent\Model;
 use Illuminate\Database\Eloquent\SoftDeletes;
 use App\Traits\ModelTimeFormat;
 
+use App\Traits\LogModelChanging;
+
 class AuditLog extends Model
 {
+    use LogModelChanging;
+
     use ModelTimeFormat;
     use SoftDeletes;
     protected $table='audit_logs';

+ 4 - 0
app/Authority.php

@@ -5,8 +5,12 @@ namespace App;
 use Illuminate\Database\Eloquent\Model;
 use App\Traits\ModelTimeFormat;
 
+use App\Traits\LogModelChanging;
+
 class Authority extends Model
 {
+    use LogModelChanging;
+
     use ModelTimeFormat;
     protected $fillable = ['name','remark','id_parent','alias_name','type','relevance','permission'];
     function roles(){

+ 4 - 0
app/Batch.php

@@ -4,8 +4,12 @@ namespace App;
 
 use Illuminate\Database\Eloquent\Model;
 
+use App\Traits\LogModelChanging;
+
 class Batch extends Model
 {
+    use LogModelChanging;
+
     protected $fillable = [
         'id','code','type', 'wms_type', 'status', 'wms_status', 'wms_created_at',"remark","owner_id",
     ];

+ 4 - 0
app/CarType.php

@@ -5,8 +5,12 @@ namespace App;
 use Illuminate\Database\Eloquent\Model;
 use App\Traits\ModelTimeFormat;
 
+use App\Traits\LogModelChanging;
+
 class CarType extends Model
 {
+    use LogModelChanging;
+
     use ModelTimeFormat;
 
     protected $fillable=[

+ 4 - 0
app/Carrier.php

@@ -5,8 +5,12 @@ namespace App;
 use Illuminate\Database\Eloquent\Model;
 use App\Traits\ModelTimeFormat;
 
+use App\Traits\LogModelChanging;
+
 class Carrier extends Model
 {
+    use LogModelChanging;
+
     use ModelTimeFormat;
     protected $fillable=[
         'name','mobile','delivery_fee','remark'

+ 4 - 0
app/City.php

@@ -2,12 +2,16 @@
 
 namespace App;
 
+use App\Traits\LogModelChanging;
 use Illuminate\Database\Eloquent\Model;
 use App\Traits\ModelTimeFormat;
 
 class City extends Model
 {
+    use LogModelChanging;
+
     use ModelTimeFormat;
+    use LogModelChanging;
     protected $fillable=[
         'province_id','name','type'
     ];

+ 4 - 0
app/Commodity.php

@@ -6,8 +6,12 @@ use Illuminate\Database\Eloquent\Builder;
 use Illuminate\Database\Eloquent\Model;
 use App\Traits\ModelTimeFormat;
 
+use App\Traits\LogModelChanging;
+
 class Commodity extends Model
 {
+    use LogModelChanging;
+
     use ModelTimeFormat;
     protected $fillable=['name','sku','owner_id','created_at','length','width','height','volumn',"type","pack_spec"];
     protected $appends=['barcode'];

+ 4 - 0
app/CommodityBarcode.php

@@ -5,8 +5,12 @@ namespace App;
 use Illuminate\Database\Eloquent\Model;
 use App\Traits\ModelTimeFormat;
 
+use App\Traits\LogModelChanging;
+
 class CommodityBarcode extends Model
 {
+    use LogModelChanging;
+
     use ModelTimeFormat;
     protected $fillable=['code','commodity_id','created_at'];
 

+ 4 - 0
app/Console/Commands/stubs/model.stub

@@ -4,7 +4,11 @@ namespace {{ namespace }};
 
 use Illuminate\Database\Eloquent\Model;
 
+use App\Traits\LogChanging;
+
 class {{ class }} extends Model
 {
+    use LogChanging;
+
     //
 }

+ 4 - 0
app/CustomField.php

@@ -4,8 +4,12 @@ namespace App;
 
 use Illuminate\Database\Eloquent\Model;
 
+use App\Traits\LogModelChanging;
+
 class CustomField extends Model
 {
+    use LogModelChanging;
+
     protected $fillable=['table',
         'field',
         'present_name',

+ 4 - 0
app/Customer.php

@@ -6,8 +6,12 @@ use App\Traits\ModelTimeFormat;
 use Illuminate\Database\Eloquent\Model;
 use Illuminate\Database\Eloquent\Relations\HasMany;
 
+use App\Traits\LogModelChanging;
+
 class Customer extends Model
 {
+    use LogModelChanging;
+
     use ModelTimeFormat;
 
     protected $fillable = [

+ 4 - 0
app/CustomerLog.php

@@ -5,8 +5,12 @@ namespace App;
 use App\Traits\ModelTimeFormat;
 use Illuminate\Database\Eloquent\Model;
 
+use App\Traits\LogModelChanging;
+
 class CustomerLog extends Model
 {
+    use LogModelChanging;
+
     use ModelTimeFormat;
 
     protected $fillable = ['customer_id', 'customer_log_status_id', 'user_id', 'description'];

+ 4 - 0
app/CustomerLogStatus.php

@@ -5,8 +5,12 @@ namespace App;
 use App\Traits\ModelTimeFormat;
 use Illuminate\Database\Eloquent\Model;
 
+use App\Traits\LogModelChanging;
+
 class CustomerLogStatus extends Model
 {
+    use LogModelChanging;
+
     use ModelTimeFormat;
 
     protected $fillable = ['name', 'description'];

+ 4 - 0
app/CustomerTag.php

@@ -5,8 +5,12 @@ namespace App;
 use App\Traits\ModelTimeFormat;
 use Illuminate\Database\Eloquent\Model;
 
+use App\Traits\LogModelChanging;
+
 class CustomerTag extends Model
 {
+    use LogModelChanging;
+
     use ModelTimeFormat;
 
     protected $fillable=[

+ 4 - 0
app/Depository.php

@@ -5,8 +5,12 @@ namespace App;
 use Illuminate\Database\Eloquent\Model;
 use App\Traits\ModelTimeFormat;
 
+use App\Traits\LogModelChanging;
+
 class Depository extends Model
 {
+    use LogModelChanging;
+
     use ModelTimeFormat;
     protected $fillable=[
         'name','code'

+ 29 - 0
app/Events/ModelChangedEvent.php

@@ -0,0 +1,29 @@
+<?php
+
+namespace App\Events;
+
+use App\LaborReport;
+use App\UserDutyCheck;
+use Illuminate\Broadcasting\Channel;
+use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
+use Illuminate\Database\Eloquent\Model;
+use Illuminate\Queue\SerializesModels;
+
+
+class ModelChangedEvent
+{
+    use  SerializesModels;
+
+    public $model;
+
+    /**
+     * Create a new event instance.
+     *
+     * @param Model $model
+     */
+    public function __construct(Model $model)
+    {
+        $this->model=$model;
+    }
+
+}

+ 1 - 1
app/Exceptions/Exception.php

@@ -8,7 +8,7 @@ use Throwable;
 
 class Exception extends \Exception
 {
-        protected $type;
+        public $type;
         public function __construct($message = "",$type='error', $code = 0, Throwable $previous = null)
         {
             parent::__construct($message, $code, $previous);

+ 24 - 20
app/Exceptions/Handler.php

@@ -2,17 +2,12 @@
 
 namespace App\Exceptions;
 
-use App\Http\Controllers\Controller;
 use App\Services\LogService;
 use Exception;
 use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
-use Illuminate\Http\Exceptions\HttpResponseException;
 use Illuminate\Http\Request;
-use Illuminate\Http\Response;
 use Illuminate\Support\Facades\Auth;
 use Illuminate\Validation\ValidationException;
-use Symfony\Component\HttpKernel\Exception\HttpException;
-use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
 use Throwable;
 
 class Handler extends ExceptionHandler
@@ -48,30 +43,39 @@ class Handler extends ExceptionHandler
         parent::report($exception);
     }
 
-    /**
-     * Render an exception into an HTTP response.
-     *
-     * @param Request $request
-     * @param Throwable $exception
-     * @return \Symfony\Component\HttpFoundation\Response|void
-     * @throws Throwable
-     */
-    public function render($request, Throwable $exception)
+
+    public function render( $request, Throwable $exception)
     {
         $errMsg='';
         try{
             $type = $exception->type ?? 'error';
-            $errMsg=(function()use($exception){
+            $errMsg=(function()use($request,$exception){
                 return $errMsg=
                     '异常: '
-                    .' code:'.(
-                    method_exists($exception,'getStatusCode')
-                        ?($exception->getStatusCode()??'')
+                    .' URL:'.(
+                    method_exists($request,'fullUrl')
+                        ?($request->fullUrl()??'')
+                        :'')
+                    .' method:'.(
+                    method_exists($request,'method')
+                        ?($request->method()??'')
+                        :'')
+                    .' params:'.(
+                    method_exists($request,'all')
+                        ?json_encode($request->all()??'')
                         :'')
                     .' errors:'.(
                     method_exists($exception,'errors')
                         ?(json_encode($exception->errors(),JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES)??'')
                         :'')
+                    .' header:'.(
+                    method_exists($request,'header')
+                        ?json_encode($request->headers->all()??'')
+                        :'')
+                    .' code:'.(
+                    method_exists($exception,'getStatusCode')
+                        ?($exception->getStatusCode()??'')
+                        :'')
                     .' message:'.(
                     method_exists($exception,'getMessage')
                         ?($exception->getMessage()??'')
@@ -110,8 +114,8 @@ class Handler extends ExceptionHandler
                     ?($exception->getTraceAsString()??'')
                     :'';
                 if(!$traces)return '';
-                preg_match('/\#0.*?\: (.*?)-\>(.*?)\(/', $traces, $result);
-                return [$result[1]??'',$result[2]??'',$traces];
+                preg_match('/\#0.*?\: (.*?)(-\>|\:\:)(.*?)\(/', $traces, $result);
+                return [$result[1]??'',$result[3]??'',$traces];
             })();
             LogService::log(
                 $className,

+ 4 - 0
app/Feature.php

@@ -4,8 +4,12 @@ namespace App;
 
 use Illuminate\Database\Eloquent\Model;
 
+use App\Traits\LogModelChanging;
+
 class Feature extends Model
 {
+    use LogModelChanging;
+
     protected $fillable = [
         "type",     //类型
         "logic",    //逻辑

+ 1 - 1
app/Http/Controllers/TestController.php

@@ -261,7 +261,7 @@ class TestController extends Controller
 
     function t1(Request $request)
     {
-        $user=City::query()->first();
+        $user=City::query()->firstx();
         $user['created_at'] = '2020-12-23';
         $user->save();
     }

+ 4 - 0
app/Http/Kernel.php

@@ -2,6 +2,7 @@
 
 namespace App\Http;
 
+use App\Http\Middleware\LogPostRequest;
 use Illuminate\Foundation\Http\Kernel as HttpKernel;
 
 class Kernel extends HttpKernel
@@ -30,6 +31,7 @@ class Kernel extends HttpKernel
      */
     protected $middlewareGroups = [
         'web' => [
+            LogPostRequest::class,
             \App\Http\Middleware\EncryptCookies::class,
             \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
             \Illuminate\Session\Middleware\StartSession::class,
@@ -40,10 +42,12 @@ class Kernel extends HttpKernel
         ],
 
         'api' => [
+            LogPostRequest::class,
 //            'throttle:60,1',
             'bindings',
         ],
         'apiLocal' => [
+            LogPostRequest::class,
             \App\Http\Middleware\EncryptCookies::class,
             \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
             \Illuminate\Session\Middleware\StartSession::class,

+ 27 - 0
app/Http/Middleware/LogPostRequest.php

@@ -0,0 +1,27 @@
+<?php
+
+namespace App\Http\Middleware;
+
+use App\Services\LogService;
+use Closure;
+
+class LogPostRequest
+{
+    /**
+     * Handle an incoming request.
+     *
+     * @param  \Illuminate\Http\Request  $request
+     * @param  \Closure  $next
+     * @return mixed
+     */
+    public function handle($request, Closure $next)
+    {
+        if($request->method()!='GET'){
+            LogService::log($request->fullUrl(),$request->method(),
+                '请求:'.json_encode($request->all())
+                .'请求头:'.json_encode($request->headers->all())
+            );
+        }
+        return $next($request);
+    }
+}

+ 0 - 11
app/Http/Requests/ForeignHaiRobotic_taskUpdateRequest.php

@@ -43,17 +43,6 @@ class ForeignHaiRobotic_taskUpdateRequest extends FormRequest
                 $validator->errors()->add('errMsg', json_encode($validator->errors()->messages(),JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES));
                 $validator->errors()->add('data',$validator->errors()->toJson(JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES));
             }
-
-            $errMsg=(function()use($validator){
-                if($validator->errors()->isEmpty())return '';
-                return $errMsg = '错误: '.$validator->errors()->toJson(JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES);
-            })();
-
-            LogService::log(__METHOD__,__FUNCTION__,
-                $errMsg??''
-                .'请求:'.json_encode($this->all())
-                .'调用堆栈:'.json_encode(array_slice(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS),0,3))
-            );
         });
     }
 }

+ 4 - 0
app/InventoryAccount.php

@@ -7,8 +7,12 @@ use Illuminate\Database\Eloquent\Model;
 use Illuminate\Database\Eloquent\SoftDeletes;
 use Illuminate\Support\Facades\Auth;
 
+use App\Traits\LogModelChanging;
+
 class InventoryAccount extends Model
 {
+    use LogModelChanging;
+
     use ModelTimeFormat;
     use SoftDeletes;
     protected $fillable=[

+ 4 - 0
app/InventoryAccountMission.php

@@ -6,8 +6,12 @@ use App\Traits\ModelTimeFormat;
 use Illuminate\Database\Eloquent\Model;
 use Illuminate\Support\Facades\Auth;
 
+use App\Traits\LogModelChanging;
+
 class InventoryAccountMission extends Model
 {
+    use LogModelChanging;
+
     use ModelTimeFormat;
     protected $fillable=[
         'id','inventory_account_id','location','commodity_id', 'produced_at', 'valid_at','stored_at','batch_number','erp_type_position','quality','stored_amount','valid_amount',

+ 4 - 0
app/InventoryBlindReceiveExcel.php

@@ -5,8 +5,12 @@ namespace App;
 use Illuminate\Database\Eloquent\Model;
 use Illuminate\Support\Facades\Storage;
 
+use App\Traits\LogModelChanging;
+
 class InventoryBlindReceiveExcel extends Model
 {
+    use LogModelChanging;
+
     //
     protected $fillable = [
         'file','goods_amount','name'

+ 4 - 0
app/InventoryCompare.php

@@ -5,8 +5,12 @@ namespace App;
 use App\Traits\ModelTimeFormat;
 use Illuminate\Database\Eloquent\Model;
 
+use App\Traits\LogModelChanging;
+
 class InventoryCompare extends Model
 {
+    use LogModelChanging;
+
     use ModelTimeFormat;
     protected $fillable=[
         'owner_id','commodity_id', 'mission_code', 'source','custom_location','quality','amount_in_sys','amount_in_compare','differ','created_at',

+ 4 - 0
app/InventoryDailyLog.php

@@ -4,8 +4,12 @@ namespace App;
 
 use Illuminate\Database\Eloquent\Model;
 
+use App\Traits\LogModelChanging;
+
 class InventoryDailyLog extends Model
 {
+    use LogModelChanging;
+
     public $timestamps=false;
     protected $fillable=[
         'owner_id','created_at','commodity_id','amount','volumn_occupied','gross_weight','depository_id'

+ 4 - 0
app/InventoryDailyLoggingOwner.php

@@ -4,8 +4,12 @@ namespace App;
 
 use Illuminate\Database\Eloquent\Model;
 
+use App\Traits\LogModelChanging;
+
 class InventoryDailyLoggingOwner extends Model
 {
+    use LogModelChanging;
+
     protected $fillable=[
         "owner_id","status"
     ];

+ 4 - 0
app/JobType.php

@@ -4,7 +4,11 @@ namespace App;
 
 use Illuminate\Database\Eloquent\Model;
 
+use App\Traits\LogModelChanging;
+
 class JobType extends Model
 {
+    use LogModelChanging;
+
     //
 }

+ 4 - 0
app/LaborCompany.php

@@ -5,8 +5,12 @@ namespace App;
 use App\Traits\ModelTimeFormat;
 use Illuminate\Database\Eloquent\Model;
 
+use App\Traits\LogModelChanging;
+
 class LaborCompany extends Model
 {
+    use LogModelChanging;
+
     use ModelTimeFormat;
     protected $fillable=[
         'id','name',

+ 4 - 0
app/LaborReport.php

@@ -10,8 +10,12 @@ use Illuminate\Support\Arr;
 use Illuminate\Support\Facades\Auth;
 use Illuminate\Support\Facades\Gate;
 
+use App\Traits\LogModelChanging;
+
 class LaborReport extends Model
 {
+    use LogModelChanging;
+
     use ModelTimeFormat;
     use SoftDeletes;
     protected $fillable=[

+ 4 - 0
app/LaborReportStatus.php

@@ -5,8 +5,12 @@ namespace App;
 use App\Traits\ModelTimeFormat;
 use Illuminate\Database\Eloquent\Model;
 
+use App\Traits\LogModelChanging;
+
 class LaborReportStatus extends Model
 {
+    use LogModelChanging;
+
     use ModelTimeFormat;
     protected $fillable=[
         'id','status','labor_report_id','created_at',

+ 32 - 0
app/Listeners/ModelChangedListener.php

@@ -0,0 +1,32 @@
+<?php
+
+namespace App\Listeners;
+
+use App\Events\ModelChangedEvent;
+use App\Services\LogService;
+
+class ModelChangedListener
+{
+    /**
+     * Create the event listener.
+     *
+     * @return void
+     */
+    public function __construct()
+    {
+    }
+
+    public function handle(ModelChangedEvent $event)
+    {
+        $traces=json_encode(array_slice(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS),6,config('exception.log.traceDepth.modelChange')));
+        preg_match('/Model.php.*?function\"\:\"(.*?)\"/', $traces, $result);
+        $methodName = $result[1]??'';
+        LogService::log(
+            get_class($event->model),
+            $methodName,
+            '对象:'.$event->model->toJson()
+            .'调用堆栈:'.$traces
+        );
+    }
+
+}

+ 3 - 1
app/Log.php

@@ -7,11 +7,13 @@ use App\Traits\ModelTimeFormat;
 use Illuminate\Database\Eloquent\Relations\HasOne;
 use Illuminate\Support\Str;
 
+use App\Traits\LogModelChanging;
+
 class Log extends Model
 {
     use ModelTimeFormat;
     protected $fillable = [
-        'operation', 'description','method', 'class', 'ip','id_user','created_at','updated_at'
+         'description','type','method', 'class', 'ip','id_user','created_at','updated_at'
     ];
     function user(): HasOne
     {

+ 4 - 0
app/Logistic.php

@@ -9,8 +9,12 @@ use Illuminate\Database\Eloquent\Model;
  * @method static Builder orderBy(string $string, string $string1)
  */use App\Traits\ModelTimeFormat;
 
+use App\Traits\LogModelChanging;
+
 class Logistic extends Model
 {
+    use LogModelChanging;
+
     use ModelTimeFormat;
     protected $fillable = ['name','code',"type","mobile","remark","delivery_fee"];
 

+ 4 - 0
app/LogisticNumberFeature.php

@@ -5,8 +5,12 @@ namespace App;
 use Illuminate\Database\Eloquent\Model;
 use App\Traits\ModelTimeFormat;
 
+use App\Traits\LogModelChanging;
+
 class LogisticNumberFeature extends Model
 {
+    use LogModelChanging;
+
     use ModelTimeFormat;
     protected $fillable=['logistic_id','name','value','weight'];
     static public $featureConsideringLength=4;

+ 4 - 0
app/LogisticTiming.php

@@ -4,8 +4,12 @@ namespace App;
 
 use Illuminate\Database\Eloquent\Model;
 
+use App\Traits\LogModelChanging;
+
 class LogisticTiming extends Model
 {
+    use LogModelChanging;
+
     //
     protected $fillable = [
         'logistic_id','to_province_id','to_city_id','days_at_working'

+ 4 - 0
app/MaterialBox.php

@@ -4,7 +4,11 @@ namespace App;
 
 use Illuminate\Database\Eloquent\Model;
 
+use App\Traits\LogModelChanging;
+
 class MaterialBox extends Model
 {
+    use LogModelChanging;
+
     protected $fillable=['code'];
 }

+ 4 - 0
app/MeasuringMachine.php

@@ -7,8 +7,12 @@ use Illuminate\Database\Eloquent\Model;
 use App\Traits\ModelTimeFormat;
 use Illuminate\Support\Carbon;
 
+use App\Traits\LogModelChanging;
+
 class MeasuringMachine extends Model
 {
+    use LogModelChanging;
+
     use ModelTimeFormat;
     protected $fillable=[
         'name','code','status',

+ 4 - 0
app/Menu.php

@@ -5,8 +5,12 @@ namespace App;
 use App\Traits\ModelTimeFormat;
 use Illuminate\Database\Eloquent\Model;
 
+use App\Traits\LogModelChanging;
+
 class Menu extends Model
 {
+    use LogModelChanging;
+
     use ModelTimeFormat;
     protected $fillable=[
         'name','level', 'parent_id', 'route','sequence',

+ 0 - 47
app/ModelExtended.php

@@ -1,47 +0,0 @@
-<?php
-
-
-namespace App;
-
-use App\Services\LogService;
-use Illuminate\Database\Eloquent\Model;
-
-class ModelExtended extends Model
-{
-    protected $isNotLogging=[
-        Log::class
-    ];
-    private $isShouldLog=null;
-    protected function log($input=''):bool{
-        if($this->isShouldLog===null)
-            $this->isShouldLog
-                =array_search(get_class($this),$this->isNotLogging)===false;
-        if(!$this->isShouldLog)return false;
-        $traces=json_encode(array_slice(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS),0,5));
-        preg_match('/\"function\"\:\".*?"function\"\:\"(.*?)\"\,\"class\"\:\".*?\"/', $traces, $result);
-        $methodName = $result[1]??'';
-        LogService::log(get_class($this),$methodName,
-            '对象:'.$this->toJson()
-            .'参数:'.json_encode([$input])
-            .'调用堆栈:'.$traces
-        );
-
-        return $this->isShouldLog;
-    }
-
-    function save(array $options = [])
-    {
-        $this->log($options);
-        return parent::save($options); // TODO: Change the autogenerated stub
-    }
-    function update(array $attributes = [], array $options = [])
-    {
-        $this->log([$attributes, $options]);
-        return parent::update($attributes, $options); // TODO: Change the autogenerated stub
-    }
-    public function delete()
-    {
-        $this->log();
-        return parent::delete(); // TODO: Change the autogenerated stub
-    }
-}

+ 4 - 0
app/OperatorLog.php

@@ -5,8 +5,12 @@ namespace App;
 use DateTimeInterface;
 use Illuminate\Database\Eloquent\Model;
 
+use App\Traits\LogModelChanging;
+
 class OperatorLog extends Model
 {
+    use LogModelChanging;
+
     const UPDATED_AT = null;
     protected $fillable=[
         'operator_logable_type','operator_logable_id','user_id','operation'

+ 4 - 0
app/OracleActAllocationDetails.php

@@ -4,8 +4,12 @@ namespace App;
 
 use Illuminate\Database\Eloquent\Model;
 
+use App\Traits\LogModelChanging;
+
 class OracleActAllocationDetails extends Model
 {
+    use LogModelChanging;
+
     protected $connection="oracle";
     protected $primaryKey="ALLOCATIONDETAILSID";
     protected $table="act_allocation_details";

+ 4 - 0
app/OracleActTransactionLog.php

@@ -10,8 +10,12 @@ use Illuminate\Database\Eloquent\Model;
  * TABLE:   ACT_TRANSACTION_LOG
  * EXPLAIN: 库存事务
  */
+use App\Traits\LogModelChanging;
+
 class OracleActTransactionLog extends Model
 {
+    use LogModelChanging;
+
     protected $connection="oracle";
     protected $table="ACT_TRANSACTION_LOG";
     /*

+ 4 - 0
app/OracleBasCode.php

@@ -9,8 +9,12 @@ use Illuminate\Database\Eloquent\Model;
  * TABLE:   BAS_Codes
  * EXPLAIN: 系统代码内容
  */
+use App\Traits\LogModelChanging;
+
 class OracleBasCode extends Model
 {
+    use LogModelChanging;
+
     protected $connection="oracle";
     protected $table="BAS_CODES";
     /*

+ 4 - 0
app/OracleBasCustomer.php

@@ -4,8 +4,12 @@ namespace App;
 
 use Illuminate\Database\Eloquent\Model;
 
+use App\Traits\LogModelChanging;
+
 class OracleBasCustomer extends Model
 {
+    use LogModelChanging;
+
     protected $connection="oracle";
     protected $table="BAS_CUSTOMER";
 }

+ 4 - 0
app/OracleBasSKU.php

@@ -10,8 +10,12 @@ use Illuminate\Database\Eloquent\Model;
  */
 use App\Traits\ModelTimeFormat;
 
+use App\Traits\LogModelChanging;
+
 class OracleBasSKU extends Model
 {
+    use LogModelChanging;
+
     use ModelTimeFormat;
     protected $connection="oracle";
     protected $table="BAS_SKU";

+ 4 - 0
app/OracleDOCASNDetail.php

@@ -5,8 +5,12 @@ namespace App;
 use Illuminate\Database\Eloquent\Model;
 use App\Traits\ModelTimeFormat;
 
+use App\Traits\LogModelChanging;
+
 class OracleDOCASNDetail extends Model
 {
+    use LogModelChanging;
+
     use ModelTimeFormat;
     protected $connection="oracle";
     protected $table="Doc_ASN_Details";

+ 4 - 0
app/OracleDOCASNHeader.php

@@ -5,8 +5,12 @@ namespace App;
 use App\Traits\ModelTimeFormat;
 use Illuminate\Database\Eloquent\Model;
 
+use App\Traits\LogModelChanging;
+
 class OracleDOCASNHeader extends Model
 {
+    use LogModelChanging;
+
     use ModelTimeFormat;
     protected $connection="oracle";
     protected $table="Doc_ASN_Header";

+ 4 - 0
app/OracleDOCMovementDetail.php

@@ -5,8 +5,12 @@ namespace App;
 use Illuminate\Database\Eloquent\Model;
 use App\Traits\ModelTimeFormat;
 
+use App\Traits\LogModelChanging;
+
 class OracleDOCMovementDetail extends Model
 {
+    use LogModelChanging;
+
     use ModelTimeFormat;
     protected $connection="oracle";
     protected $table="DOC_Movement_Details";

+ 4 - 0
app/OracleDOCMovementHeader.php

@@ -5,8 +5,12 @@ namespace App;
 use Illuminate\Database\Eloquent\Model;
 use App\Traits\ModelTimeFormat;
 
+use App\Traits\LogModelChanging;
+
 class OracleDOCMovementHeader extends Model
 {
+    use LogModelChanging;
+
     use ModelTimeFormat;
     protected $connection="oracle";
     protected $table="DOC_Movement_Header";

+ 4 - 0
app/OracleDOCOrderDetail.php

@@ -4,8 +4,12 @@ namespace App;
 
 use Illuminate\Database\Eloquent\Model;
 
+use App\Traits\LogModelChanging;
+
 class OracleDOCOrderDetail extends Model
 {
+    use LogModelChanging;
+
     protected $connection="oracle";
     protected $table="DOC_Order_Details";
     protected $fillable = ['sku','customerId'];

+ 4 - 0
app/OracleDOCOrderHeader.php

@@ -5,8 +5,12 @@ namespace App;
 use App\Traits\ModelTimeFormat;
 use Illuminate\Database\Eloquent\Model;
 
+use App\Traits\LogModelChanging;
+
 class OracleDOCOrderHeader extends Model
 {
+    use LogModelChanging;
+
 
     use ModelTimeFormat;
     protected $connection="oracle";

+ 4 - 0
app/OracleDOCWaveDetails.php

@@ -4,8 +4,12 @@ namespace App;
 
 use Illuminate\Database\Eloquent\Model;
 
+use App\Traits\LogModelChanging;
+
 class OracleDOCWaveDetails extends Model
 {
+    use LogModelChanging;
+
     protected $connection='oracle';
     protected $table='DOC_WAVE_DETAILS';
 

+ 4 - 0
app/OracleDOCWaveHeader.php

@@ -5,8 +5,12 @@ namespace App;
 use Illuminate\Database\Eloquent\Model;
 use App\Traits\ModelTimeFormat;
 
+use App\Traits\LogModelChanging;
+
 class OracleDOCWaveHeader extends Model
 {
+    use LogModelChanging;
+
     use ModelTimeFormat;
     protected $fillable=[
         'WAVENO','ROUTE','TRANSPORTATION','ORDERTYPE','PRIORITY','WCSSENDFLAG','WCSSENDTIME','WCSSENDDESCR','DESCR','USERDEFINE1','USERDEFINE2','USERDEFINE3','USERDEFINE4','USERDEFINE5','RELEASESTATUS','WAVESTATUS','ADDTIME','ADDWHO','EDITTIME','EDITWHO','EDISENDTIME','WAREHOUSEID','CUSTOMERID','CUBIC','GROSSWEIGHT','TASKDISPATCH','CROSSAREA','TASKSTATUS','WAVERULE','CARRIERID','GROUPNUMBER','SORTATIONTYPE','UDFPRINTFLAG1','UDFPRINTFLAG2','UDFPRINTFLAG3','WORKINGAREA','WAVEDISPATCHID','WAVEGROUPNO','WAVEGROUPPRINTFLAG','WAV_TSK_MGM','ASSORTINGID'

+ 4 - 0
app/OracleDocOrderPackingSummary.php

@@ -6,8 +6,12 @@ use Carbon\Carbon;
 use Illuminate\Database\Eloquent\Model;
 use Illuminate\Support\Facades\DB;
 
+use App\Traits\LogModelChanging;
+
 class OracleDocOrderPackingSummary extends Model
 {
+    use LogModelChanging;
+
     protected $connection="oracle";
     protected $primaryKey="traceid";
     protected $table = 'doc_order_packing_summary';

+ 4 - 0
app/OracleIdxAsrsReceive.php

@@ -6,8 +6,12 @@ use Carbon\Carbon;
 use Illuminate\Database\Eloquent\Model;
 use Illuminate\Support\Facades\DB;
 
+use App\Traits\LogModelChanging;
+
 class OracleIdxAsrsReceive extends Model
 {
+    use LogModelChanging;
+
     protected $connection="oracle";
     protected $primaryKey="GROUPTASKID";
     protected $table = 'idx_asrs_receive';

+ 9 - 1
app/OracleInvLotAtt.php

@@ -9,12 +9,20 @@ use Illuminate\Database\Eloquent\Model;
  * TABLE:   INV_LOT_ATT
  * EXPLAIN: 批次属性
  */
+use App\Traits\LogModelChanging;
+
 class OracleInvLotAtt extends Model
 {
+    use LogModelChanging;
+
+    public function __construct(array $attributes = [])
+    {
+        $this->timestamps=false;
+        parent::__construct($attributes);
+    }
 
     protected $connection="oracle";
     protected $table="INV_LOT_ATT";
-    public $timestamps=false;
     /*
      * column: LotAtt05 属性仓
      *         LotAtt08 质量状态

+ 4 - 0
app/OracleInvLotLocId.php

@@ -10,8 +10,12 @@ use Illuminate\Database\Eloquent\Model;
  * TABLE:   INV_LOT_LOC_ID
  * EXPLAIN: 库存状态
  */
+use App\Traits\LogModelChanging;
+
 class OracleInvLotLocId extends Model
 {
+    use LogModelChanging;
+
     protected $connection="oracle";
     protected $table="INV_LOT_LOC_ID";
 

+ 4 - 0
app/Order.php

@@ -5,8 +5,12 @@ namespace App;
 use App\Traits\ModelTimeFormat;
 use Illuminate\Database\Eloquent\Model;
 
+use App\Traits\LogModelChanging;
+
 class Order extends Model
 {
+    use LogModelChanging;
+
     //
     use ModelTimeFormat;
 

+ 4 - 0
app/OrderBin.php

@@ -4,8 +4,12 @@ namespace App;
 
 use Illuminate\Database\Eloquent\Model;
 
+use App\Traits\LogModelChanging;
+
 class OrderBin extends Model
 {
+    use LogModelChanging;
+
     protected $fillable = [
         'order_id', 'number',
     ];

+ 4 - 0
app/OrderCommodity.php

@@ -5,8 +5,12 @@ namespace App;
 use App\Http\Controllers\Controller;
 use Illuminate\Database\Eloquent\Model;
 
+use App\Traits\LogModelChanging;
+
 class OrderCommodity extends Model
 {
+    use LogModelChanging;
+
     protected $fillable = [
         'id', 'order_id','commodity_id', 'amount','wms_ptltaskid','location'
     ];

+ 4 - 0
app/OrderCommodityAssign.php

@@ -5,8 +5,12 @@ namespace App;
 use App\Traits\ModelTimeFormat;
 use Illuminate\Database\Eloquent\Model;
 
+use App\Traits\LogModelChanging;
+
 class OrderCommodityAssign extends Model
 {
+    use LogModelChanging;
+
     use ModelTimeFormat;
     protected $fillable = [
         "order_id",         //外键订单

+ 4 - 0
app/OrderCountingRecord.php

@@ -4,8 +4,12 @@ namespace App;
 
 use Illuminate\Database\Eloquent\Model;
 
+use App\Traits\LogModelChanging;
+
 class OrderCountingRecord extends Model
 {
+    use LogModelChanging;
+
     //
     protected $fillable = ['owner_id','shop_id' ,'warehouse_id' ,'logistic_id' ,'date_target' ,'counting_unit' ,'amount','year','month','week'];
 

+ 4 - 0
app/OrderIssue.php

@@ -6,8 +6,12 @@ use App\Traits\ModelTimeFormat;
 use Illuminate\Database\Eloquent\Model;
 use Illuminate\Database\Eloquent\SoftDeletes;
 
+use App\Traits\LogModelChanging;
+
 class OrderIssue extends Model
 {
+    use LogModelChanging;
+
     //
     use ModelTimeFormat;
     use SoftDeletes;

+ 4 - 0
app/OrderIssueOnTop.php

@@ -5,8 +5,12 @@ namespace App;
 use App\Traits\ModelTimeFormat;
 use Illuminate\Database\Eloquent\Model;
 
+use App\Traits\LogModelChanging;
+
 class OrderIssueOnTop extends Model
 {
+    use LogModelChanging;
+
     //
     use ModelTimeFormat;
 

+ 4 - 0
app/OrderIssueProcessLog.php

@@ -5,8 +5,12 @@ namespace App;
 use App\Traits\ModelTimeFormat;
 use Illuminate\Database\Eloquent\Model;
 
+use App\Traits\LogModelChanging;
+
 class OrderIssueProcessLog extends Model
 {
+    use LogModelChanging;
+
     //
     use ModelTimeFormat;
 

+ 4 - 0
app/OrderIssueType.php

@@ -5,8 +5,12 @@ namespace App;
 use App\Traits\ModelTimeFormat;
 use Illuminate\Database\Eloquent\Model;
 
+use App\Traits\LogModelChanging;
+
 class OrderIssueType extends Model
 {
+    use LogModelChanging;
+
     //
     use ModelTimeFormat;
 

+ 4 - 0
app/OrderPackage.php

@@ -13,8 +13,12 @@ use Illuminate\Support\Arr;
 use Illuminate\Support\Facades\Auth;
 use Illuminate\Support\Facades\DB;
 
+use App\Traits\LogModelChanging;
+
 class OrderPackage extends Model
 {
+    use LogModelChanging;
+
     use ModelTimeFormat;
 
     protected $fillable = ['order_id','logistic_number','batch_number',

+ 4 - 0
app/OrderPackageCommodities.php

@@ -5,8 +5,12 @@ namespace App;
 use App\Traits\ModelTimeFormat;
 use Illuminate\Database\Eloquent\Model;
 
+use App\Traits\LogModelChanging;
+
 class OrderPackageCommodities extends Model
 {
+    use LogModelChanging;
+
     //
     use ModelTimeFormat;
 

+ 4 - 0
app/OrderTracking.php

@@ -5,8 +5,12 @@ namespace App;
 use App\Traits\ModelTimeFormat;
 use Illuminate\Database\Eloquent\Model;
 
+use App\Traits\LogModelChanging;
+
 class OrderTracking extends Model
 {
+    use LogModelChanging;
+
 
     use ModelTimeFormat;
     protected $fillable = [

+ 4 - 0
app/OrderTrackingOwner.php

@@ -5,8 +5,12 @@ namespace App;
 use App\Traits\ModelTimeFormat;
 use Illuminate\Database\Eloquent\Model;
 
+use App\Traits\LogModelChanging;
+
 class OrderTrackingOwner extends Model
 {
+    use LogModelChanging;
+
     //
     use ModelTimeFormat;
     protected $fillable = ['owner_id','status'];

+ 4 - 0
app/Owner.php

@@ -11,8 +11,12 @@ use Illuminate\Support\Facades\Auth;
  */
 use App\Traits\ModelTimeFormat;
 
+use App\Traits\LogModelChanging;
+
 class Owner extends Model
 {
+    use LogModelChanging;
+
     use ModelTimeFormat;
     public $fillable = [
         'name',                 //名称

+ 4 - 0
app/OwnerAreaReport.php

@@ -4,8 +4,12 @@ namespace App;
 
 use Illuminate\Database\Eloquent\Model;
 
+use App\Traits\LogModelChanging;
+
 class OwnerAreaReport extends Model
 {
+    use LogModelChanging;
+
     protected $fillable = [
         "owner_id",             //货主ID
         "counting_month",       //结算月

+ 4 - 0
app/OwnerBillReport.php

@@ -4,8 +4,12 @@ namespace App;
 
 use Illuminate\Database\Eloquent\Model;
 
+use App\Traits\LogModelChanging;
+
 class OwnerBillReport extends Model
 {
+    use LogModelChanging;
+
    protected $fillable = [
        "owner_id",       //项目ID
        "counting_month", //结算月

+ 4 - 0
app/OwnerContract.php

@@ -5,8 +5,12 @@ namespace App;
 use App\Traits\ModelTimeFormat;
 use Illuminate\Database\Eloquent\Model;
 
+use App\Traits\LogModelChanging;
+
 class OwnerContract extends Model
 {
+    use LogModelChanging;
+
     use ModelTimeFormat;
 
     protected $fillable=[

+ 4 - 0
app/OwnerFeeDetail.php

@@ -5,8 +5,12 @@ namespace App;
 use App\Services\ProcessMethodService;
 use Illuminate\Database\Eloquent\Model;
 
+use App\Traits\LogModelChanging;
+
 class OwnerFeeDetail extends Model
 {
+    use LogModelChanging;
+
     protected $fillable = [
         "owner_id",         //货主ID
         "worked_at",        //作业时间

+ 4 - 0
app/OwnerInStorageRule.php

@@ -4,8 +4,12 @@ namespace App;
 
 use Illuminate\Database\Eloquent\Model;
 
+use App\Traits\LogModelChanging;
+
 class OwnerInStorageRule extends Model
 {
+    use LogModelChanging;
+
     protected $fillable = [
         "owner_price_operation_id", //作业计费ID
         "amount",                   //计量

+ 4 - 0
app/OwnerOutStorageRule.php

@@ -4,8 +4,12 @@ namespace App;
 
 use Illuminate\Database\Eloquent\Model;
 
+use App\Traits\LogModelChanging;
+
 class OwnerOutStorageRule extends Model
 {
+    use LogModelChanging;
+
     protected $fillable = [
         "owner_price_operation_id",         //作业计费ID
         "strategy",                         //出库策略

+ 4 - 0
app/OwnerPriceDirectLogistic.php

@@ -5,8 +5,12 @@ namespace App;
 use Illuminate\Database\Eloquent\Model;
 use Illuminate\Support\Facades\DB;
 
+use App\Traits\LogModelChanging;
+
 class OwnerPriceDirectLogistic extends Model
 {
+    use LogModelChanging;
+
     protected $fillable = [
         "name",     //名称
         "base_km"   //起步公里数

+ 4 - 0
app/OwnerPriceDirectLogisticCar.php

@@ -4,8 +4,12 @@ namespace App;
 
 use Illuminate\Database\Eloquent\Model;
 
+use App\Traits\LogModelChanging;
+
 class OwnerPriceDirectLogisticCar extends Model
 {
+    use LogModelChanging;
+
     protected $fillable = [
         "owner_price_direct_logistic_id",   //直发车计费ID
         "car_type_id",                      //车型ID

+ 4 - 0
app/OwnerPriceExpress.php

@@ -5,8 +5,12 @@ namespace App;
 use Illuminate\Database\Eloquent\Model;
 use Illuminate\Support\Facades\DB;
 
+use App\Traits\LogModelChanging;
+
 class OwnerPriceExpress extends Model
 {
+    use LogModelChanging;
+
     protected $fillable = [
         "name",             //名称
         "initial_weight",   //首重

+ 4 - 0
app/OwnerPriceExpressProvince.php

@@ -4,8 +4,12 @@ namespace App;
 
 use Illuminate\Database\Eloquent\Model;
 
+use App\Traits\LogModelChanging;
+
 class OwnerPriceExpressProvince extends Model
 {
+    use LogModelChanging;
+
     protected $fillable = [
         "owner_price_express_id",   //快递价格ID
         "province_id",              //省份ID

+ 4 - 0
app/OwnerPriceLogistic.php

@@ -5,8 +5,12 @@ namespace App;
 use Illuminate\Database\Eloquent\Model;
 use Illuminate\Support\Facades\DB;
 
+use App\Traits\LogModelChanging;
+
 class OwnerPriceLogistic extends Model
 {
+    use LogModelChanging;
+
     protected $fillable = [
         "name",             //名称
         "unit_range",       //单价一区间

+ 4 - 0
app/OwnerPriceLogisticDetail.php

@@ -4,8 +4,12 @@ namespace App;
 
 use Illuminate\Database\Eloquent\Model;
 
+use App\Traits\LogModelChanging;
+
 class OwnerPriceLogisticDetail extends Model
 {
+    use LogModelChanging;
+
     protected $fillable = [
         "owner_price_logistic_id",  //物流计费
         "unit_id",                  //单位ID

+ 4 - 0
app/OwnerPriceOperation.php

@@ -4,8 +4,12 @@ namespace App;
 
 use Illuminate\Database\Eloquent\Model;
 
+use App\Traits\LogModelChanging;
+
 class OwnerPriceOperation extends Model
 {
+    use LogModelChanging;
+
     protected $fillable = [
         "operation_type",   //操作类型
         "name",             //名称

+ 4 - 0
app/OwnerReport.php

@@ -6,8 +6,12 @@ use App\Traits\ModelTimeFormat;
 use Carbon\Carbon;
 use Illuminate\Database\Eloquent\Model;
 
+use App\Traits\LogModelChanging;
+
 class OwnerReport extends Model
 {
+    use LogModelChanging;
+
     use ModelTimeFormat;
     protected $fillable = [
         "owner_id",                     //货主ID

+ 4 - 0
app/OwnerStoragePriceModel.php

@@ -4,8 +4,12 @@ namespace App;
 
 use Illuminate\Database\Eloquent\Model;
 
+use App\Traits\LogModelChanging;
+
 class OwnerStoragePriceModel extends Model
 {
+    use LogModelChanging;
+
     protected $fillable = [
         "counting_type",    //计费类型
         "using_type",       //用仓类型

+ 4 - 0
app/OwnerStoragePriceModelOwner.php

@@ -4,7 +4,11 @@ namespace App;
 
 use Illuminate\Database\Eloquent\Model;
 
+use App\Traits\LogModelChanging;
+
 class OwnerStoragePriceModelOwner extends Model
 {
+    use LogModelChanging;
+
     protected $table = "owner_storage_price_model_owner";
 }

+ 4 - 0
app/Package.php

@@ -10,8 +10,12 @@ use App\Traits\ModelTimeFormat;
 use Illuminate\Support\Arr;
 use Illuminate\Support\Facades\DB;
 
+use App\Traits\LogModelChanging;
+
 class Package extends Model
 {
+    use LogModelChanging;
+
     use ModelTimeFormat;
     protected $fillable=[
         'owner_id','logistic_number','delivery_number','batch_number','batch_rule','recipient','recipient_mobile','logistic_id',

+ 4 - 0
app/PaperBox.php

@@ -5,8 +5,12 @@ namespace App;
 use Illuminate\Database\Eloquent\Model;
 use App\Traits\ModelTimeFormat;
 
+use App\Traits\LogModelChanging;
+
 class PaperBox extends Model
 {
+    use LogModelChanging;
+
     use ModelTimeFormat;
     protected $fillable=[
         'model','length','width','height',

+ 4 - 0
app/Process.php

@@ -7,8 +7,12 @@ use App\Traits\ModelTimeFormat;
 use Illuminate\Database\Eloquent\SoftDeletes;
 use Illuminate\Support\Facades\Auth;
 
+use App\Traits\LogModelChanging;
+
 class Process extends Model
 {
+    use LogModelChanging;
+
     use ModelTimeFormat;
     use SoftDeletes;
     protected $fillable=[

+ 4 - 0
app/ProcessDaily.php

@@ -5,8 +5,12 @@ namespace App;
 use Illuminate\Database\Eloquent\Model;
 use App\Traits\ModelTimeFormat;
 
+use App\Traits\LogModelChanging;
+
 class ProcessDaily extends Model
 {
+    use LogModelChanging;
+
     use ModelTimeFormat;
     protected $fillable=[
         'process_id','date','output','remain'

+ 4 - 0
app/ProcessDailyParticipant.php

@@ -6,8 +6,12 @@ use Carbon\Carbon;
 use Illuminate\Database\Eloquent\Model;
 use App\Traits\ModelTimeFormat;
 
+use App\Traits\LogModelChanging;
+
 class ProcessDailyParticipant extends Model
 {
+    use LogModelChanging;
+
     use ModelTimeFormat;
     protected $fillable=[
         'process_daily_id','user_id','started_at','ended_at','hour_price',

+ 4 - 0
app/ProcessMethod.php

@@ -5,8 +5,12 @@ namespace App;
 use Illuminate\Database\Eloquent\Model;
 use App\Traits\ModelTimeFormat;
 
+use App\Traits\LogModelChanging;
+
 class ProcessMethod extends Model
 {
+    use LogModelChanging;
+
     use ModelTimeFormat;
     protected $fillable=['name',"unit_id","unit_price"];
 

+ 4 - 0
app/ProcessStatistic.php

@@ -5,8 +5,12 @@ namespace App;
 use Illuminate\Database\Eloquent\Model;
 use App\Traits\ModelTimeFormat;
 
+use App\Traits\LogModelChanging;
+
 class ProcessStatistic extends Model
 {
+    use LogModelChanging;
+
     use ModelTimeFormat;
     //重新约定主键且不允许自增
     protected $primaryKey='process_id';

+ 4 - 0
app/ProcessesContent.php

@@ -5,8 +5,12 @@ namespace App;
 use Illuminate\Database\Eloquent\Model;
 use App\Traits\ModelTimeFormat;
 
+use App\Traits\LogModelChanging;
+
 class ProcessesContent extends Model
 {
+    use LogModelChanging;
+
     use ModelTimeFormat;
     protected $fillable=[
         'process_id','bill_type','commodity_id','wms_code','amount','type'

+ 5 - 0
app/Providers/EventServiceProvider.php

@@ -2,6 +2,8 @@
 
 namespace App\Providers;
 
+use App\Events\ModelChangedEvent;
+use App\Listeners\ModelChangedListener;
 use Illuminate\Support\Facades\Event;
 use Illuminate\Auth\Events\Registered;
 use Illuminate\Auth\Listeners\SendEmailVerificationNotification;
@@ -30,6 +32,9 @@ class EventServiceProvider extends ServiceProvider
         'App\Events\ResetProcessStatisticStartDateEvent' =>[
             'App\Listeners\ResetProcessStatisticStartDateListener'
         ],
+        ModelChangedEvent::class =>[
+            ModelChangedListener::class
+        ],
     ];
 
     /**

+ 4 - 0
app/Province.php

@@ -5,8 +5,12 @@ namespace App;
 use Illuminate\Database\Eloquent\Model;
 use App\Traits\ModelTimeFormat;
 
+use App\Traits\LogModelChanging;
+
 class Province extends Model
 {
+    use LogModelChanging;
+
     use ModelTimeFormat;
     protected $fillable=[
         'name'

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است