OrderActionLogModel.php
1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
namespace App\Model;
use Illuminate\Database\Eloquent\Model;
use Request;
use Excel;
use DB;
class OrderActionLogModel extends Model
{
protected $connection = 'order';
protected $table = 'lie_order_action_log';
protected $primaryKey = 'log_id';
public $timestamps = false;
/**
* 操作记录
* @param [Integer] $order_id [订单ID]
* @param [Integer] $operator_id [操作人]
* @param [Integer] $operator_type [操作人类型:1.网站用户,2.CMS用户, 3-系统定时任务,4-ERP,5-WMS,6-中金]
* @param [string] $event [操作事件]
* @return [type] [description]
*/
public function addLog($order_id, $operator_id, $operator_type = 1, $event='')
{
$log['order_id'] = $order_id;
$log['operator_id'] = $operator_id;
$log['operator_type'] = $operator_type;
$log['event'] = $event;
$log['ip'] = get_client_ip(0, true);
$log['create_time'] = time();
$actionLog = $this->insert($log);
if (!$actionLog) return false;
return $actionLog;
}
}