webmain/model/whereModel.php
(开头部分) 7KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
<?php
class whereClassModel extends Model
{
private $moders = array();
private $ursarr = array();
private $admindbs;
public function initModel()
{
$this->settable('flow_where');
$this->admindbs = m('admin');
}
/**
* 条件格式化,返回是没有and开头的
*/
public function getstrwhere($str, $uid=0, $fid='')
{
if(isempt($str))return '';
if($uid==0)$uid = $this->adminid;
$dbs = $this->admindbs;
if(isset($this->ursarr[$uid])){
$urs = $this->ursarr[$uid];
}else{
$urs = $dbs->getone($uid);
$this->ursarr[$uid] = $urs;
}
$companyid = arrvalue($urs, 'companyid','0'); //对应单位ID
$deptid = arrvalue($urs, 'deptid','0'); //部门ID
if(ISMORECOM){
$comid = arrvalue($urs, 'comid','0');
if($comid>'0')$companyid = $comid;
}
$sw1 = $this->rock->dbinstr('superid',$uid);
$super = "select `id` from `[Q]admin` where $sw1";//我的直属下属
$allsuper = "select `id` from `[Q]admin` where instr(`superpath`,'[$uid]')>0"; //我所有下属的下属
$companys = "select `id` from `[Q]admin` where `companyid`=".$companyid.""; //对应单位下的
//加上a.
$str = str_replace('[A]`uid`','`uid`', $str);
$str = str_replace('[A]uid','`uid`', $str);
$barr = $this->rock->matcharr($str,2);
$itsha= array('status','uid','optid','optname','applydt','createdt','createid');
$thar = array();
foreach($barr as $bsuid){
if(in_array($bsuid, $itsha) && !in_array($bsuid, $thar)){
$thar[] = $bsuid;
$str = str_replace('`'.$bsuid.'`','{asqom}`'.$bsuid.'`', $str);
}
}
$str = m('base')->strreplace($str, $uid);
$str = str_replace(array('{super}','{allsuper}','{company}'), array($super,$allsuper,$companys), $str);
//未读替换
if(contain($str,'{unread}')){
后面还有 185 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。
