22 lines
506 B
PHP
22 lines
506 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class MerchantLog extends BaseModel
|
|
{
|
|
//
|
|
public static function addLog($str){
|
|
$table=new self();
|
|
$table->merchant_id=merchant('id');
|
|
$table->ip=request()->getClientIp();
|
|
$table->desc=$str;
|
|
$table->url=request()->path();//操作路径
|
|
return $table->save();
|
|
}
|
|
public function merchants(){
|
|
return $this->belongsTo('App\Models\Merchant','merchant_id','id');
|
|
}
|
|
}
|