当前位置: 首页>>代码示例>>PHP>>正文


PHP Log::create方法代码示例

本文整理汇总了PHP中app\models\Log::create方法的典型用法代码示例。如果您正苦于以下问题:PHP Log::create方法的具体用法?PHP Log::create怎么用?PHP Log::create使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app\models\Log的用法示例。


在下文中一共展示了Log::create方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: boot

 public static function boot()
 {
     parent::boot();
     static::creating(function ($model) {
         if ($model->carsubmodelid == 0) {
             CommissionExtraCar::where('commissionextraid', $model->commissionextraid)->where('carmodelid', $model->carmodelid)->delete();
         }
         $model->createdby = Auth::user()->id;
         $model->createddate = date("Y-m-d H:i:s");
         $model->modifiedby = Auth::user()->id;
         $model->modifieddate = date("Y-m-d H:i:s");
     });
     static::created(function ($model) {
         Log::create(['employeeid' => Auth::user()->id, 'operation' => 'Add', 'date' => date("Y-m-d H:i:s"), 'model' => class_basename(get_class($model)), 'detail' => $model->toJson()]);
     });
     static::updating(function ($model) {
         if ($model->carsubmodelid == 0) {
             CommissionExtraCar::where('id', '!=', $model->id)->where('commissionextraid', $model->commissionextraid)->where('carmodelid', $model->carmodelid)->delete();
         }
         $model->modifiedby = Auth::user()->id;
         $model->modifieddate = date("Y-m-d H:i:s");
     });
     static::updated(function ($model) {
         Log::create(['employeeid' => Auth::user()->id, 'operation' => 'Update', 'date' => date("Y-m-d H:i:s"), 'model' => class_basename(get_class($model)), 'detail' => $model->toJson()]);
     });
     static::deleted(function ($model) {
         Log::create(['employeeid' => Auth::user()->id, 'operation' => 'Delete', 'date' => date("Y-m-d H:i:s"), 'model' => class_basename(get_class($model)), 'detail' => $model->toJson()]);
     });
 }
开发者ID:x-Zyte,项目名称:nissanhippro,代码行数:29,代码来源:CommissionExtraCar.php

示例2: boot

 public static function boot()
 {
     parent::boot();
     static::creating(function ($model) {
         $carpreemption = CarPreemption::find($model->carpreemptionid);
         $model->provinceid = $carpreemption->provinceid;
         $model->branchid = $carpreemption->branchid;
         $model->createdby = Auth::user()->id;
         $model->createddate = date("Y-m-d H:i:s");
         $model->modifiedby = Auth::user()->id;
         $model->modifieddate = date("Y-m-d H:i:s");
     });
     static::created(function ($model) {
         Log::create(['employeeid' => Auth::user()->id, 'operation' => 'Add', 'date' => date("Y-m-d H:i:s"), 'model' => class_basename(get_class($model)), 'detail' => $model->toJson()]);
         $carpreemption = CarPreemption::find($model->carpreemptionid);
         $carpreemption->status = 2;
         $carpreemption->save();
     });
     static::updating(function ($model) {
         $carpreemption = CarPreemption::find($model->carpreemptionid);
         $model->provinceid = $carpreemption->provinceid;
         $model->branchid = $carpreemption->branchid;
         $model->modifiedby = Auth::user()->id;
         $model->modifieddate = date("Y-m-d H:i:s");
     });
     static::updated(function ($model) {
         Log::create(['employeeid' => Auth::user()->id, 'operation' => 'Update', 'date' => date("Y-m-d H:i:s"), 'model' => class_basename(get_class($model)), 'detail' => $model->toJson()]);
     });
     static::deleted(function ($model) {
         Log::create(['employeeid' => Auth::user()->id, 'operation' => 'Delete', 'date' => date("Y-m-d H:i:s"), 'model' => class_basename(get_class($model)), 'detail' => $model->toJson()]);
         $carpreemption = CarPreemption::find($model->carpreemptionid);
         $carpreemption->status = 0;
         $carpreemption->save();
     });
 }
开发者ID:x-Zyte,项目名称:nissanhippro,代码行数:35,代码来源:CancelCarPreemption.php

示例3: boot

 public static function boot()
 {
     parent::boot();
     static::creating(function ($model) {
         $carpayment = CarPayment::find($model->carpaymentid);
         $model->provinceid = $carpayment->provinceid;
         $model->branchid = $carpayment->branchid;
         $model->createdby = Auth::user()->id;
         $model->createddate = date("Y-m-d H:i:s");
         $model->modifiedby = Auth::user()->id;
         $model->modifieddate = date("Y-m-d H:i:s");
     });
     static::created(function ($model) {
         Log::create(['employeeid' => Auth::user()->id, 'operation' => 'Add', 'date' => date("Y-m-d H:i:s"), 'model' => class_basename(get_class($model)), 'detail' => $model->toJson()]);
     });
     static::updating(function ($model) {
         $carpayment = CarPayment::find($model->carpaymentid);
         $model->provinceid = $carpayment->provinceid;
         $model->branchid = $carpayment->branchid;
         $model->accountingDetailReceiveAndPays()->delete();
         $model->modifiedby = Auth::user()->id;
         $model->modifieddate = date("Y-m-d H:i:s");
     });
     static::updated(function ($model) {
         Log::create(['employeeid' => Auth::user()->id, 'operation' => 'Update', 'date' => date("Y-m-d H:i:s"), 'model' => class_basename(get_class($model)), 'detail' => $model->toJson()]);
     });
     static::deleting(function ($model) {
         $model->accountingDetailReceiveAndPays()->delete();
     });
     static::deleted(function ($model) {
         Log::create(['employeeid' => Auth::user()->id, 'operation' => 'Delete', 'date' => date("Y-m-d H:i:s"), 'model' => class_basename(get_class($model)), 'detail' => $model->toJson()]);
     });
 }
开发者ID:x-Zyte,项目名称:nissanhippro,代码行数:33,代码来源:AccountingDetail.php

示例4: boot

 public static function boot()
 {
     parent::boot();
     static::creating(function ($model) {
         $model->effectivefrom = date('Y-m-d', strtotime($model->effectivefrom));
         $model->effectiveto = date('Y-m-d', strtotime($model->effectiveto));
         $model->createdby = Auth::user()->id;
         $model->createddate = date("Y-m-d H:i:s");
         $model->modifiedby = Auth::user()->id;
         $model->modifieddate = date("Y-m-d H:i:s");
     });
     static::created(function ($model) {
         Log::create(['employeeid' => Auth::user()->id, 'operation' => 'Add', 'date' => date("Y-m-d H:i:s"), 'model' => class_basename(get_class($model)), 'detail' => $model->toJson()]);
     });
     static::updating(function ($model) {
         $model->effectivefrom = date('Y-m-d', strtotime($model->effectivefrom));
         $model->effectiveto = date('Y-m-d', strtotime($model->effectiveto));
         $model->modifiedby = Auth::user()->id;
         $model->modifieddate = date("Y-m-d H:i:s");
     });
     static::updated(function ($model) {
         Log::create(['employeeid' => Auth::user()->id, 'operation' => 'Update', 'date' => date("Y-m-d H:i:s"), 'model' => class_basename(get_class($model)), 'detail' => $model->toJson()]);
     });
     static::deleted(function ($model) {
         Log::create(['employeeid' => Auth::user()->id, 'operation' => 'Delete', 'date' => date("Y-m-d H:i:s"), 'model' => class_basename(get_class($model)), 'detail' => $model->toJson()]);
     });
 }
开发者ID:x-Zyte,项目名称:nissanhippro,代码行数:27,代码来源:CommissionSpecial.php

示例5: boot

 public static function boot()
 {
     parent::boot();
     static::creating(function ($model) {
         if ($model->isadmin) {
             $model->branchid = null;
             $model->departmentid = null;
             $model->teamid = null;
         } else {
             if ($model->branchid == '') {
                 $model->branchid = null;
             }
             if ($model->departmentid == '') {
                 $model->departmentid = null;
             }
             if ($model->teamid == '') {
                 $model->teamid = null;
             }
         }
         $model->password = bcrypt("nissanhippro");
         $model->createdby = Auth::user()->id;
         $model->createddate = date("Y-m-d H:i:s");
         $model->modifiedby = Auth::user()->id;
         $model->modifieddate = date("Y-m-d H:i:s");
     });
     static::created(function ($model) {
         Log::create(['employeeid' => Auth::user()->id, 'operation' => 'Add', 'date' => date("Y-m-d H:i:s"), 'model' => class_basename(get_class($model)), 'detail' => $model->toJson()]);
     });
     static::updating(function ($model) {
         if ($model->isadmin) {
             $model->branchid = null;
             $model->departmentid = null;
             $model->teamid = null;
         } else {
             if ($model->branchid == '') {
                 $model->branchid = null;
             }
             if ($model->departmentid == '') {
                 $model->departmentid = null;
             }
             if ($model->teamid == '') {
                 $model->teamid = null;
             }
         }
         $model->modifiedby = Auth::user()->id;
         $model->modifieddate = date("Y-m-d H:i:s");
     });
     static::updated(function ($model) {
         Log::create(['employeeid' => Auth::user()->id, 'operation' => 'Update', 'date' => date("Y-m-d H:i:s"), 'model' => class_basename(get_class($model)), 'detail' => $model->toJson()]);
     });
     static::deleted(function ($model) {
         Log::create(['employeeid' => Auth::user()->id, 'operation' => 'Delete', 'date' => date("Y-m-d H:i:s"), 'model' => class_basename(get_class($model)), 'detail' => $model->toJson()]);
     });
 }
开发者ID:x-Zyte,项目名称:nhp,代码行数:54,代码来源:Employee.php

示例6: authenticate

 /**
  * Handle an authentication attempt.
  *
  * @return Response
  */
 public function authenticate(Request $request)
 {
     $email = Input::get('email');
     $password = Input::get('password');
     $remember = Input::get('remember');
     if (Auth::attempt(['email' => $email, 'password' => $password], $remember)) {
         Log::create(['action' => '登录系统', 'userid' => Auth::user()->id, 'username' => Auth::user()->name]);
         return redirect()->intended('orders');
     }
     return Redirect::to('/auth/login')->with('errors', array($this->loginUsername() => '用户名或密码错误'));
 }
开发者ID:cdandy,项目名称:meta-admin,代码行数:16,代码来源:LoginController.php

示例7: log

 public static function log($type, $value, $additional = null, $vars = null)
 {
     $ip = Request::ip();
     $user = Auth::user();
     if ($user) {
         $user_id = $user->id;
     } else {
         $user_id = 0;
     }
     $l = Log::create(['user_id' => $user_id, 'ip' => $ip, 'type' => $type, 'key_value' => $value, 'additional_value' => $additional, 'var' => $vars]);
     return $l;
 }
开发者ID:blozixdextr,项目名称:adtw,代码行数:12,代码来源:LogMapper.php

示例8: boot

 public static function boot()
 {
     parent::boot();
     static::creating(function ($model) {
         $model->createdby = Auth::user()->id;
         $model->createddate = date("Y-m-d H:i:s");
         $model->modifiedby = Auth::user()->id;
         $model->modifieddate = date("Y-m-d H:i:s");
     });
     static::created(function ($model) {
         Log::create(['employeeid' => Auth::user()->id, 'operation' => 'Add', 'date' => date("Y-m-d H:i:s"), 'model' => class_basename(get_class($model)), 'detail' => $model->toJson()]);
         if ($model->isheadquarter) {
             for ($i = 1; $i <= $model->keyslot; $i++) {
                 $m = new KeySlot();
                 $m->provinceid = $model->provinceid;
                 $m->no = $i;
                 $m->active = true;
                 $m->save();
             }
         }
     });
     static::updating(function ($model) {
         $model->modifiedby = Auth::user()->id;
         $model->modifieddate = date("Y-m-d H:i:s");
     });
     static::updated(function ($model) {
         Log::create(['employeeid' => Auth::user()->id, 'operation' => 'Update', 'date' => date("Y-m-d H:i:s"), 'model' => class_basename(get_class($model)), 'detail' => $model->toJson()]);
         if ($model->isheadquarter) {
             $max = KeySlot::where('provinceid', $model->provinceid)->max('no');
             if ($max == null) {
                 $max = 0;
             }
             if ($model->keyslot > $max) {
                 for ($i = $max + 1; $i <= $model->keyslot; $i++) {
                     $m = new KeySlot();
                     $m->provinceid = $model->provinceid;
                     $m->no = $i;
                     $m->active = true;
                     $m->save();
                 }
             } elseif ($model->keyslot < $max) {
                 KeySlot::where('provinceid', $model->provinceid)->where('no', '>', $model->keyslot)->delete();
             }
         }
     });
     static::deleted(function ($model) {
         Log::create(['employeeid' => Auth::user()->id, 'operation' => 'Delete', 'date' => date("Y-m-d H:i:s"), 'model' => class_basename(get_class($model)), 'detail' => $model->toJson()]);
         if ($model->isheadquarter) {
             KeySlot::where('provinceid', $model->provinceid)->delete();
         }
     });
 }
开发者ID:x-Zyte,项目名称:nhp,代码行数:52,代码来源:Branch.php

示例9: boot

 public static function boot()
 {
     parent::boot();
     static::creating(function ($model) {
         $model->issold = false;
         $model->isregistered = false;
         $model->isdelivered = false;
         $model->dodate = date('Y-m-d', strtotime($model->dodate));
         $model->receiveddate = date('Y-m-d', strtotime($model->receiveddate));
         $model->createdby = Auth::user()->id;
         $model->createddate = date("Y-m-d H:i:s");
         $model->modifiedby = Auth::user()->id;
         $model->modifieddate = date("Y-m-d H:i:s");
     });
     static::created(function ($model) {
         Log::create(['employeeid' => Auth::user()->id, 'operation' => 'Add', 'date' => date("Y-m-d H:i:s"), 'model' => class_basename(get_class($model)), 'detail' => $model->toJson()]);
         $rs = DB::select('call running_number("' . $model->provinceid . date("Y") . '","' . $model->receivetype . '")');
         $model->no = $rs[0]->no;
         $min = KeySlot::where('provinceid', $model->provinceid)->where('active', true)->min('no');
         if ($min == null) {
             $branch = Branch::where('provinceid', $model->provinceid)->where('isheadquarter', true)->first();
             $branch->keyslot = $branch->keyslot + 1;
             $branch->save();
             $model->keyno = $branch->keyslot;
         } else {
             $model->keyno = $min;
         }
         $model->save();
         KeySlot::where('provinceid', $model->provinceid)->where('no', $model->keyno)->update(['active' => false]);
     });
     static::updating(function ($model) {
         $model->dodate = date('Y-m-d', strtotime($model->dodate));
         $model->receiveddate = date('Y-m-d', strtotime($model->receiveddate));
         $model->modifiedby = Auth::user()->id;
         $model->modifieddate = date("Y-m-d H:i:s");
     });
     static::updated(function ($model) {
         Log::create(['employeeid' => Auth::user()->id, 'operation' => 'Update', 'date' => date("Y-m-d H:i:s"), 'model' => class_basename(get_class($model)), 'detail' => $model->toJson()]);
     });
     static::deleted(function ($model) {
         Log::create(['employeeid' => Auth::user()->id, 'operation' => 'Delete', 'date' => date("Y-m-d H:i:s"), 'model' => class_basename(get_class($model)), 'detail' => $model->toJson()]);
         if ($model->receivecarfilepath != '') {
             File::delete(public_path() . $model->receivecarfilepath);
         }
         if ($model->deliverycarfilepath != '') {
             File::delete(public_path() . $model->deliverycarfilepath);
         }
         KeySlot::where('provinceid', $model->provinceid)->where('no', $model->keyno)->update(['active' => true]);
     });
 }
开发者ID:x-Zyte,项目名称:nhp,代码行数:50,代码来源:Car.php

示例10: boot

 public static function boot()
 {
     parent::boot();
     static::updating(function ($model) {
         if ($model->returncashpledgedate != null && $model->returncashpledgedate != '') {
             $model->returncashpledgedate = date('Y-m-d', strtotime($model->returncashpledgedate));
         } else {
             $model->returncashpledgedate = null;
         }
         $model->modifiedby = Auth::user()->id;
         $model->modifieddate = date("Y-m-d H:i:s");
     });
     static::updated(function ($model) {
         Log::create(['employeeid' => Auth::user()->id, 'operation' => 'Update', 'date' => date("Y-m-d H:i:s"), 'model' => class_basename(get_class($model)), 'detail' => $model->toJson()]);
     });
 }
开发者ID:x-Zyte,项目名称:nissanhippro,代码行数:16,代码来源:ReturnCashPledgeRedLabel.php

示例11: boot

 public static function boot()
 {
     parent::boot();
     static::creating(function ($model) {
         if ($model->occupationid == '') {
             $model->occupationid = null;
         }
         if ($model->districtid == '') {
             $model->districtid = null;
         }
         if ($model->amphurid == '') {
             $model->amphurid = null;
         }
         if ($model->addprovinceid == '') {
             $model->addprovinceid = null;
         }
         $model->createdby = Auth::user()->id;
         $model->createddate = date("Y-m-d H:i:s");
         $model->modifiedby = Auth::user()->id;
         $model->modifieddate = date("Y-m-d H:i:s");
     });
     static::created(function ($model) {
         Log::create(['employeeid' => Auth::user()->id, 'operation' => 'Add', 'date' => date("Y-m-d H:i:s"), 'model' => class_basename(get_class($model)), 'detail' => $model->toJson()]);
     });
     static::updating(function ($model) {
         if ($model->occupationid == '') {
             $model->occupationid = null;
         }
         if ($model->districtid == '') {
             $model->districtid = null;
         }
         if ($model->amphurid == '') {
             $model->amphurid = null;
         }
         if ($model->addprovinceid == '') {
             $model->addprovinceid = null;
         }
         $model->modifiedby = Auth::user()->id;
         $model->modifieddate = date("Y-m-d H:i:s");
     });
     static::updated(function ($model) {
         Log::create(['employeeid' => Auth::user()->id, 'operation' => 'Update', 'date' => date("Y-m-d H:i:s"), 'model' => class_basename(get_class($model)), 'detail' => $model->toJson()]);
     });
     static::deleted(function ($model) {
         Log::create(['employeeid' => Auth::user()->id, 'operation' => 'Delete', 'date' => date("Y-m-d H:i:s"), 'model' => class_basename(get_class($model)), 'detail' => $model->toJson()]);
     });
 }
开发者ID:x-Zyte,项目名称:nhp,代码行数:47,代码来源:Customer.php

示例12: boot

 public static function boot()
 {
     parent::boot();
     static::creating(function ($model) {
         $model->customerid = null;
         $model->carid = null;
         $model->deposit = null;
         if (!strpos($model->no, "-")) {
             $model->no = substr_replace($model->no, "-", strlen($model->no) - 4, 0);
         }
         $model->createdby = Auth::user()->id;
         $model->createddate = date("Y-m-d H:i:s");
         $model->modifiedby = Auth::user()->id;
         $model->modifieddate = date("Y-m-d H:i:s");
     });
     static::created(function ($model) {
         Log::create(['employeeid' => Auth::user()->id, 'operation' => 'Add', 'date' => date("Y-m-d H:i:s"), 'model' => class_basename(get_class($model)), 'detail' => $model->toJson()]);
     });
     static::updating(function ($model) {
         if ($model->customerid == '') {
             $model->customerid = null;
         }
         if ($model->carid == '') {
             $model->carid = null;
         }
         if ($model->deposit == '') {
             $model->deposit = null;
         }
         if (!strpos($model->no, "-")) {
             $model->no = substr_replace($model->no, "-", strlen($model->no) - 4, 0);
         }
         $model->modifiedby = Auth::user()->id;
         $model->modifieddate = date("Y-m-d H:i:s");
     });
     static::updated(function ($model) {
         Log::create(['employeeid' => Auth::user()->id, 'operation' => 'Update', 'date' => date("Y-m-d H:i:s"), 'model' => class_basename(get_class($model)), 'detail' => $model->toJson()]);
     });
     static::deleted(function ($model) {
         Log::create(['employeeid' => Auth::user()->id, 'operation' => 'Delete', 'date' => date("Y-m-d H:i:s"), 'model' => class_basename(get_class($model)), 'detail' => $model->toJson()]);
     });
 }
开发者ID:x-Zyte,项目名称:nissanhippro,代码行数:41,代码来源:RedLabel.php

示例13: boot

 public static function boot()
 {
     parent::boot();
     static::creating(function ($model) {
         if ($model->effectiveto != null && $model->effectiveto != '') {
             $model->effectiveto = date('Y-m-d', strtotime($model->effectiveto));
         }
         $model->effectivefrom = date('Y-m-d', strtotime($model->effectivefrom));
         $model->sellingpricewithaccessories = $model->sellingprice + $model->margin;
         $model->execusivetotalmargincampaing = $model->margin + $model->execusiveinternal + $model->execusivecampaing;
         $model->totalmargincampaing = $model->margin + $model->internal + $model->campaing;
         $model->createdby = Auth::user()->id;
         $model->createddate = date("Y-m-d H:i:s");
         $model->modifiedby = Auth::user()->id;
         $model->modifieddate = date("Y-m-d H:i:s");
     });
     static::created(function ($model) {
         Log::create(['employeeid' => Auth::user()->id, 'operation' => 'Add', 'date' => date("Y-m-d H:i:s"), 'model' => class_basename(get_class($model)), 'detail' => $model->toJson()]);
     });
     static::updating(function ($model) {
         if ($model->effectiveto != null && $model->effectiveto != '') {
             $model->effectiveto = date('Y-m-d', strtotime($model->effectiveto));
         }
         $model->effectivefrom = date('Y-m-d', strtotime($model->effectivefrom));
         $model->sellingpricewithaccessories = $model->sellingprice + $model->margin;
         $model->execusivetotalmargincampaing = $model->margin + $model->execusiveinternal + $model->execusivecampaing;
         $model->totalmargincampaing = $model->margin + $model->internal + $model->campaing;
         $model->modifiedby = Auth::user()->id;
         $model->modifieddate = date("Y-m-d H:i:s");
     });
     static::updated(function ($model) {
         Log::create(['employeeid' => Auth::user()->id, 'operation' => 'Update', 'date' => date("Y-m-d H:i:s"), 'model' => class_basename(get_class($model)), 'detail' => $model->toJson()]);
     });
     static::deleted(function ($model) {
         Log::create(['employeeid' => Auth::user()->id, 'operation' => 'Delete', 'date' => date("Y-m-d H:i:s"), 'model' => class_basename(get_class($model)), 'detail' => $model->toJson()]);
     });
 }
开发者ID:x-Zyte,项目名称:nissanhippro,代码行数:37,代码来源:Pricelist.php

示例14: boot

 public static function boot()
 {
     parent::boot();
     static::creating(function ($model) {
         $carpreemption = CarPreemption::find($model->carpreemptionid);
         $model->provinceid = $carpreemption->provinceid;
         $model->branchid = $carpreemption->branchid;
         if ($model->insurancecompanyid == '') {
             $model->insurancecompanyid = null;
         }
         if ($model->capitalinsurance == '') {
             $model->capitalinsurance = null;
         }
         if ($model->buyerpay == '') {
             $model->buyerpay = null;
         }
         if ($model->overdue == '') {
             $model->overdue = null;
         }
         if ($model->overdueinterest == '') {
             $model->overdueinterest = null;
         }
         if ($model->totaloverdue == '') {
             $model->totaloverdue = null;
         }
         if ($model->paybytype == '') {
             $model->paybytype = null;
         }
         if ($model->paybyotherdetails == '') {
             $model->paybyotherdetails = null;
         }
         if ($model->overdueinstallments == '') {
             $model->overdueinstallments = null;
         }
         if ($model->overdueinstallmentdate1 == '') {
             $model->overdueinstallmentdate1 = null;
         }
         if ($model->overdueinstallmentamount1 == '') {
             $model->overdueinstallmentamount1 = null;
         }
         if ($model->overdueinstallmentdate2 == '') {
             $model->overdueinstallmentdate2 = null;
         }
         if ($model->overdueinstallmentamount2 == '') {
             $model->overdueinstallmentamount2 = null;
         }
         if ($model->overdueinstallmentdate3 == '') {
             $model->overdueinstallmentdate3 = null;
         }
         if ($model->overdueinstallmentamount3 == '') {
             $model->overdueinstallmentamount3 = null;
         }
         if ($model->overdueinstallmentdate4 == '') {
             $model->overdueinstallmentdate4 = null;
         }
         if ($model->overdueinstallmentamount4 == '') {
             $model->overdueinstallmentamount4 = null;
         }
         if ($model->overdueinstallmentdate5 == '') {
             $model->overdueinstallmentdate5 = null;
         }
         if ($model->overdueinstallmentamount5 == '') {
             $model->overdueinstallmentamount5 = null;
         }
         if ($model->overdueinstallmentdate6 == '') {
             $model->overdueinstallmentdate6 = null;
         }
         if ($model->overdueinstallmentamount6 == '') {
             $model->overdueinstallmentamount6 = null;
         }
         if ($model->oldcarbuyername == '') {
             $model->oldcarbuyername = null;
         }
         if ($model->oldcarpayamount == '') {
             $model->oldcarpayamount = null;
         }
         if ($model->oldcarpaytype == '') {
             $model->oldcarpaytype = null;
         }
         if ($model->oldcarpaydate == '') {
             $model->oldcarpaydate = null;
         }
         if ($model->payeeemployeeid == '') {
             $model->payeeemployeeid = null;
         }
         if ($model->deliverycarbookno == '') {
             $model->deliverycarbookno = null;
         }
         if ($model->deliverycarno == '') {
             $model->deliverycarno = null;
         }
         if ($model->deliverycardate == '') {
             $model->deliverycardate = null;
         }
         $model->createdby = Auth::user()->id;
         $model->createddate = date("Y-m-d H:i:s");
         $model->modifiedby = Auth::user()->id;
         $model->modifieddate = date("Y-m-d H:i:s");
     });
     static::created(function ($model) {
//.........这里部分代码省略.........
开发者ID:x-Zyte,项目名称:nissanhippro,代码行数:101,代码来源:CarPayment.php

示例15: boot

 public static function boot()
 {
     parent::boot();
     static::creating(function ($model) {
         if ($model->occupationid == '') {
             $model->occupationid = null;
         }
         if ($model->districtid == '') {
             $model->districtid = null;
         }
         if ($model->amphurid == '') {
             $model->amphurid = null;
         }
         if ($model->addprovinceid == '') {
             $model->addprovinceid = null;
         }
         if ($model->birthdate != null && $model->birthdate != '') {
             $model->birthdate = date('Y-m-d', strtotime($model->birthdate));
         } else {
             $model->birthdate = null;
         }
         //$model->isreal = false;
         $model->statusexpect = 0;
         $model->createdby = Auth::user()->id;
         $model->createddate = date("Y-m-d H:i:s");
         $model->modifiedby = Auth::user()->id;
         $model->modifieddate = date("Y-m-d H:i:s");
     });
     static::created(function ($model) {
         Log::create(['employeeid' => Auth::user()->id, 'operation' => 'Add', 'date' => date("Y-m-d H:i:s"), 'model' => class_basename(get_class($model)), 'detail' => $model->toJson()]);
     });
     static::updating(function ($model) {
         if ($model->occupationid == '') {
             $model->occupationid = null;
         }
         if ($model->districtid == '') {
             $model->districtid = null;
         }
         if ($model->amphurid == '') {
             $model->amphurid = null;
         }
         if ($model->addprovinceid == '') {
             $model->addprovinceid = null;
         }
         if ($model->birthdate != null && $model->birthdate != '') {
             $model->birthdate = date('Y-m-d', strtotime($model->birthdate));
         } else {
             $model->birthdate = null;
         }
         $model->modifiedby = Auth::user()->id;
         $model->modifieddate = date("Y-m-d H:i:s");
     });
     static::updated(function ($model) {
         Log::create(['employeeid' => Auth::user()->id, 'operation' => 'Update', 'date' => date("Y-m-d H:i:s"), 'model' => class_basename(get_class($model)), 'detail' => $model->toJson()]);
         if ($model->statusexpect != 1) {
             CustomerExpectation::where('customerid', $model->id)->where('active', true)->update(['active' => false]);
         }
     });
     static::deleted(function ($model) {
         Log::create(['employeeid' => Auth::user()->id, 'operation' => 'Delete', 'date' => date("Y-m-d H:i:s"), 'model' => class_basename(get_class($model)), 'detail' => $model->toJson()]);
     });
 }
开发者ID:x-Zyte,项目名称:nissanhippro,代码行数:62,代码来源:Customer.php


注:本文中的app\models\Log::create方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。