webmain/model/logModel.php

(开头部分) 4KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<?php
class logClassModel extends Model
{
	public function addlog($type='', $remark='', $sarr=array())
	{
		$arr['type']	= $type;
		$arr['ip']		= $this->rock->ip;
		$arr['web']		= $this->rock->web;
		$arr['optdt']	= $this->rock->now();
		$arr['optid']	= $this->adminid;
		$arr['optname']	= $this->adminname;
		$arr['remark']	= $remark;
		//$arr['url']		= $this->rock->nowurl();//不记录这个没用
		foreach($sarr as $k=>$v)$arr[$k]=$v;
		return $this->insert($arr);
	}
	
	/**
	*	添加日志的 $level=2错误
	*/
	public function addlogs($type='', $remark='', $level=0, $sarr=array())
	{
		$sarr['level'] = $level;
		return $this->addlog($type, $remark, $sarr);
	}
	
	/**
	*	提醒返回错误日志添加
	*/
	public function todolog($type,$barr=array())
	{
		if((int)arrvalue($barr,'errcode',0) != 0)$this->addlogs($type,''.$barr['errcode'].':'.$barr['msg'].'', 2);
	}
	
	public function addread($table, $mid, $uid=0)
	{
		if($uid==0)$uid=$this->adminid;
		$where  		= "`table`='$table' and `mid`='$mid' and `optid`=$uid";
		$dbs 			= m('reads');
		$onrs 			= $dbs->getone($where);
		if(!$onrs){
			$arr['table']	= $table;
			$arr['mid']		= $mid;
			$arr['optid']	= $uid;
			$arr['stotal']	= 1;
			$arr['adddt']	= $this->rock->now();
			$where 			= '';
		}else{
			$arr['stotal']	= (int)$onrs['stotal']+1;
		}
		//$arr['ip']		= $this->rock->ip;//存这个没用,不在存储
		//$arr['web']		= $this->rock->web;
		$arr['optdt']	= $this->rock->now();
		$dbs->record($arr, $where);
	}
	
	/**
	*	获取已读人员
	*/
	public function getreadarr($table, $mid)
后面还有 101 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。