45], [['admin_ip', 'route'], 'string', 'max' => 255], ]; } /** * @inheritdoc */ public function attributeLabels() { return [ 'id' => 'ID', 'title' => 'Title', 'addtime' => 'Addtime', 'admin_name' => 'Admin Name', 'admin_id' => 'Admin ID', 'admin_ip' => 'Admin Ip', 'route' => 'Route', 'action_type' => 'Action Type', 'obj_id' => 'Obj ID', 'result' => 'Result', 'store_id' => 'Store ID', 'is_delete' => 'Is Delete', ]; } /** * @param $errorInfo array 错误信息 * @param $storeId integer 商城ID * @param $actionType string 日志描述 * @param $objId integer 错误信息产生对应表的ID * @return bool */ public static function addTask($errorInfo, $storeId, $actionType, $objId) { $actionLog = new ActionLog(); $actionLog->store_id = $storeId; $actionLog->title = "定时任务"; $actionLog->addtime = time(); $actionLog->admin_name = "系统自身"; $actionLog->admin_id = 0; $actionLog->admin_ip = ''; $actionLog->route = ''; $actionLog->action_type = $actionType; $actionLog->obj_id = $objId; $actionLog->result = json_encode($errorInfo, JSON_UNESCAPED_UNICODE); $actionLog->type = 1; return $actionLog->save(); } }