发布v2.6.8版本

This commit is contained in:
雨中磐石
2025-03-31 20:54:32 +08:00
parent 0701e2a8b4
commit d41bd27082
122 changed files with 9827 additions and 9132 deletions

View File

@@ -112,10 +112,12 @@ class adminClassModel extends Model
$tj[] = $this->rock->dbinstr($fids, 'all');
$tj[] = $this->rock->dbinstr($fids, 'u'.$uid);
if($us){
$dep = explode(',', $us['deptpath']);
foreach($dep as $deps){
$_deps = str_replace(array('[',']'), array('',''), $deps);
$tj[] = $this->rock->dbinstr($fids, 'd'.$_deps);
if(!isempt($us['deptpath'])){
$dep = explode(',', $us['deptpath']);
foreach($dep as $deps){
$_deps = str_replace(array('[',']'), array('',''), $deps);
$tj[] = $this->rock->dbinstr($fids, 'd'.$_deps);
}
}
//所在组Id
$gids = m('sjoin')->getgroupid($uid);

View File

@@ -91,18 +91,21 @@ class beifenClassModel extends Model
foreach($fields as $k=>$frs){
$fname = $frs['name'];
if($fname=='id')continue;
$nstr = $this->getfielstr($frs);
$nstr = $this->getfielstr($frs);
$frs['explain'] = '';
$nstr1 = $this->getfielstr($frs);
if(!isset($nowfiel[$fname])){
$str.=',add '.$nstr.'';
}else{
$ofrs = $nowfiel[$fname]; //系统上字段类型
$ostr = $this->getfielstr($ofrs);
//$ostr = $this->getfielstr($ofrs);
$ofrs['explain'] = '';
$ostr1 = $this->getfielstr($ofrs);
$lxarr= array('text','mediumtext','bigint');
//如果自己字段长度大于官网就不更新
if($frs['type']==$ofrs['type'] && !isempt($ofrs['lens']) && $ofrs['lens']>$frs['lens']){
}else if($nstr != $ostr && !in_array($ofrs['type'], $lxarr) ){
}else if($nstr1 != $ostr1 && !in_array($ofrs['type'], $lxarr) ){
$str.=',MODIFY '.$nstr.'';
}
}

View File

@@ -31,7 +31,7 @@ class crmClassModel extends Model
}
//读取所有客户
public function custdata()
public function custdata($whe='')
{
$limit = (int)$this->rock->get('limit', '10');
$page = (int)$this->rock->get('page', '1');
@@ -41,6 +41,10 @@ class crmClassModel extends Model
$key= $this->rock->jm->base64decode($key);
$where.= " and (`name` like '%$key%' or `unitname` like '%$key%')";
}
if($whe){
$whe = str_replace('{uid}', $this->adminid, $whe);
$where .= " AND $whe";
}
$rows = $this->getrows("`status`=1 ".$where."",'SQL_CALC_FOUND_ROWS id as value,name,id,unitname as subname','`optdt` desc',''.(($page-1)*$limit).','.$limit.'');
$totalCount = $this->db->found_rows();
return array(

View File

@@ -120,12 +120,11 @@ class fileClassModel extends Model
if(!file_exists($thumbpath))$thumbpath='';
}
if(isempt($thumbpath))$thumbpath = arrvalue($rs, 'thumbplat');
if(!isempt($thumbpath)){
$thumbpath = str_replace('{FILEURL}', getconfig('rockfile_url'), $thumbpath);
$thumbpath = $this->rock->gethttppath($thumbpath);
$thumbplat = arrvalue($rs, 'thumbplat');
if(!isempt($thumbplat)){
$thumbpath = str_replace('{FILEURL}', getconfig('rockfile_url'), $thumbplat);
}
return $thumbpath;
return $this->rock->gethttppath($thumbpath);
}
@@ -339,7 +338,10 @@ class fileClassModel extends Model
header('location:'.$filepath.'');
return;
}
if($this->rock->get('openfrom')=='iosapp'){
header('location:'.$filepath.'');
return;
}
if($filesize > 10*1024*1024 && 1==1 && $fileext!='pdf'){
header('location:'.$filepath.'');
}else{

View File

@@ -37,7 +37,7 @@ class flow_carmreseClassModel extends flowModel
$db = m('carmrese');
//读取车辆最后公里数
foreach($rows as $k=>$rs){
$onrs = $db->getone("`status`=1 and `carid`=".$rs['value']." and ifnull(`kmend`,'')<>''", '`kmend`,`kmstart`','`kmend` desc');
$onrs = $db->getone("`status`=1 and `carid`=".$rs['value']." and ifnull(`kmend`,0)<>0", '`kmend`,`kmstart`','`kmend` desc');
$km = '';
if($onrs){
$km = $onrs['kmend'];

File diff suppressed because one or more lines are too long

View File

@@ -3,8 +3,14 @@
class flow_goodsClassModel extends flowModel
{
public $base;
public function initModel()
{
$this->base = m('goods');
}
protected function flowchangedata(){
$this->rs['typeid'] = m('goods')->gettypename($this->rs['typeid']);
$this->rs['typeid'] = $this->base->gettypename($this->rs['typeid']);
}
//导入数据的测试显示
@@ -40,6 +46,10 @@ class flow_goodsClassModel extends flowModel
//
public function flowrsreplace($rs, $lx=0)
{
if(isset($rs['typeid']) && is_numeric($rs['typeid']))
$rs['typeid'] = $this->base->gettypename($rs['typeid']);
//详情页下显示对应仓库库存
if($lx==1){
$drows = $this->db->getall("SELECT `depotid`,sum(count)count FROM `[Q]goodss` where aid=".$rs['id']." and `status`=1 GROUP BY `depotid`");
@@ -84,4 +94,18 @@ class flow_goodsClassModel extends flowModel
m('goodss')->delete('`aid`='.$this->id.'');
m('goods')->setstock();
}
protected function flowbillwhere($uid, $lx)
{
$where = '';
$typeid = $this->rock->post('typeid','0');
if($typeid!='0'){
$alltpeid = m('option')->getalldownid($typeid);
$where .= ' and `typeid` in('.$alltpeid.')';
}
return array(
'where' => $where,
'order' => 'optdt desc',
);
}
}

View File

@@ -51,15 +51,17 @@ class flow_meetClassModel extends flowModel
$nzt = $zt;
$time = time();
$stime = strtotime($rs['startdt']);
$etime = strtotime($rs['enddt']);
if($zt < 2){
if($etime<$time){
$nzt = 2;
}else if($stime>$time){
$nzt = 0;
}else{
$nzt = 1;
if(!isempt($rs['startdt']) && !isempt($rs['enddt'])){
$stime = strtotime($rs['startdt']);
$etime = strtotime($rs['enddt']);
if($zt < 2){
if($etime<$time){
$nzt = 2;
}else if($stime>$time){
$nzt = 0;
}else{
$nzt = 1;
}
}
}
@@ -231,9 +233,13 @@ class flow_meetClassModel extends flowModel
//每天运行计划任务将固定会议生成普通会议通知对应人
public function createmeet($id=0, $nowdt='', $gbrr=false)
{
$owhe = '';
if($id>0)$owhe='`id`='.$id.' and ';
$narr = $this->getall(''.$owhe.'`type`=1 and `status`=1');
if(is_array($id)){
$narr = $id;
}else{
$owhe = '';
if($id>0)$owhe='`id`='.$id.' and ';
$narr = $this->getall(''.$owhe.'`type`=1 and `status`=1');
}
$dtobj = c('date');
$jlarr = array();
foreach($narr as $k=>$rs){

View File

@@ -87,7 +87,7 @@ class flow_subscribeinfoClassModel extends flowModel
$newid = $this->insert(array(
'mid' => $id,
'receid' => $receid,
'recename' => $recename,
'recename' => $this->rock->xssrepstr($recename),
'title' => $title,
'cont' => $cont,
'optdt' => $this->rock->now,

View File

@@ -154,7 +154,7 @@ class flowbillClassModel extends Model
$modename = $mors['name'];
$rers = $this->db->getone('[Q]'.$rs['table'].'', $rs['mid']);
if($rers){
$tihsrs = $flow->flowrsreplace($rers, 2);
$tihsrs = $flow->rsreplace($rers, 2, null, 1);
$summary = $this->rock->reparr($mors['summary'], $tihsrs);
$summarx = $this->rock->reparr($mors['summarx'], $tihsrs);
@@ -316,7 +316,7 @@ class flowbillClassModel extends Model
$rers = $this->db->getone('[Q]'.$rs['table'].'', $rs['mid']);
$summary = $this->rock->reparr($summary, $rers);
if($rers){
$tihsrs = $flow->flowrsreplace($rers, 2);
$tihsrs = $flow->rsreplace($rers, 2, null, 1);
$summary = $this->rock->reparr($mors['summary'], $tihsrs);
$nowsets = $rs['nowcheckname']; //当前审核人

View File

@@ -66,7 +66,7 @@ class inputClassModel extends Model
$strm.= '&nbsp;&nbsp;&nbsp;{删,'.$xu.'}';
$strm.= '</td></tr></table>';
if($ism==0)$str.='<div style="background-color:#F1F1F1;">{新增,'.$xu.'}</div>';
if($ism==0)$str.='<div class="addys">{新增,'.$xu.'}</div>';
if($ism==1){
$str.='<div>{新增,'.$xu.'}</div>';
$strm.='<div style="margin:8px">{新增,'.$xu.'}</div>';

View File

@@ -468,6 +468,8 @@ class kqjcmdClassModel extends Model
//保存指纹
public function savefingerprint($snid, $uid, $finge)
{
$snid = (int)$snid;
$uid = (int)$uid;
$where = "`snid`='$snid' and `uid`='$uid'";
$arr['fingerprint1'] = str_replace("\n",'', arrvalue($finge, 0));
$arr['fingerprint2'] = str_replace("\n",'', arrvalue($finge, 1));
@@ -483,6 +485,8 @@ class kqjcmdClassModel extends Model
//保存设备头像
private function saveheadpic($snid, $uid, $headpic, $face='')
{
$snid = (int)$snid;
$uid = (int)$uid;
$where = "`snid`='$snid' and `uid`='$uid'";
if(isempt($face)){
if(isempt($headpic))return;

View File

@@ -48,8 +48,8 @@ class logClassModel extends Model
}else{
$arr['stotal'] = (int)$onrs['stotal']+1;
}
$arr['ip'] = $this->rock->ip;
$arr['web'] = $this->rock->web;
//$arr['ip'] = $this->rock->ip;//存这个没用,不在存储
//$arr['web'] = $this->rock->web;
$arr['optdt'] = $this->rock->now();
$dbs->record($arr, $where);
}

View File

@@ -66,6 +66,7 @@ class loginClassModel extends Model
if(getconfig('systype')=='demo')$this->db->update('[Q]admin', '`status`=1' , '`id`=1 and `status`=0');
//1.先用用户名判断
$arrs = array(
'user' => $user,
@@ -122,9 +123,8 @@ class loginClassModel extends Model
if($us)$loginx = '姓名';
}
if($msg=='' && !$us){
$msg = '用户不存在';
$msg = '用户或密码不对'; //用户不存在时提示
}else if($msg==''){
$uid = $us['id'];
$user = $us['user'];
@@ -142,7 +142,7 @@ class loginClassModel extends Model
}
}else{
if(md5($pass)!=$us['pass'])$msg='密码不对';
if(md5($pass)!=$us['pass'])$msg='用户或密码不对'; //密码不对提示
if($msg!='' && $pass==md5($us['pass']) && c('cache')->get('login'.$user.'')==$uid){
$msg='';

View File

@@ -675,14 +675,16 @@ class reimClassModel extends Model
if($frs){
$type = $frs['fileext'];
$path = $frs['filepath'];
$isimg= $this->contain($imgext, ','.$type.',');
$boc = false;
if(substr($path,0,4)=='http' || !isempt($frs['filenum'])){
$boc = true;
}else{
if(file_exists($path))$boc = true;
}
if($isimg && !isempt($frs['thumbplat']))$boc = true;
if($boc){
if($this->contain($imgext, ','.$type.',')){
if($isimg){
$frs['thumbpath'] = $fobj->getthumbpath($frs);
//$cont = '<img fid="'.$fid.'" src="'.$frs['thumbpath'].'">';
//$rows[$k]['cont'] = $this->rock->jm->base64encode($cont);
@@ -858,6 +860,7 @@ class reimClassModel extends Model
if(isset($cans['fileid']))$fileid=$cans['fileid'];
if(isset($cans['msgid']))$msgid=$cans['msgid'];
$pushcont = arrvalue($cans, 'pushcont');
$ispushapp = arrvalue($cans, 'ispushapp');//是否推送app
$arr = array(
'cont' => $cont,
'sendid' => $sendid,
@@ -900,20 +903,21 @@ class reimClassModel extends Model
if($sendid!=$receid)$this->addhistory('user', $sendid, $receid, $optdt, $cont, $sendid,'','', $arr['id']);
//推送的原生App上(使用异步推送哦)
$tuicont['sendid'] = $arr['sendid'];
$tuicont['sendname'] = $this->adminname;
$tuicont['name'] = $this->adminname;
$tuicont['cont'] = $cont;
$tuicont['pushcont'] = $pushcont;
$tuicont['pushtype'] = 'chat'; //推送消息类型
$tuicont['receid'] = $receid;
$tuicont['fileid'] = $fileid;
$tuicont['type'] = 'user';
$tuicont['id'] = $arr['id'];
$tuicont['optdt'] = $optdt;
$tuicont['optdts'] = substr($optdt,11,5);
$this->pushapp($receid, '['.$this->adminname.']发来一条消息', $tuicont, $lx);
if($ispushapp != 'no'){
$tuicont['sendid'] = $arr['sendid'];
$tuicont['sendname'] = $this->adminname;
$tuicont['name'] = $this->adminname;
$tuicont['cont'] = $cont;
$tuicont['pushcont'] = $pushcont;
$tuicont['pushtype'] = 'chat'; //推送消息类型
$tuicont['receid'] = $receid;
$tuicont['fileid'] = $fileid;
$tuicont['type'] = 'user';
$tuicont['id'] = $arr['id'];
$tuicont['optdt'] = $optdt;
$tuicont['optdts'] = substr($optdt,11,5);
$this->pushapp($receid, '['.$this->adminname.']发来一条消息', $tuicont, $lx);
}
/*
$last = date('Y-m-d H:i:s', time()-15);
$where = "`uid`='$receid' and `online`=1 and `cfrom` in('appandroid','appios') and `moddt`<'$last'";
@@ -1062,7 +1066,8 @@ class reimClassModel extends Model
}
$uwhere = "$where `status`=1";
$rows = m('logintoken')->getrows("`uid` in(select id from `[Q]admin` where $uwhere) and `cfrom` in ('nppandroid','nppios') and `online`=1",'*','id desc');
$uida = $pushuids = $alias2019 = $uid2019 = array();
$jpreg = '';
$uida = $pushuids = $alias2019 = $uid2019 = $jparr = array();
$uids = '0';
$times = date('Y-m-d H:i:s', time()-5*60);//5分钟
foreach($rows as $k=>$rs){
@@ -1076,14 +1081,19 @@ class reimClassModel extends Model
$nestr.=''.$rs['pushtoken'].''; //个推
}else if(contain($_web,'huawei') && !contain($rs['ip'],'.')){
$nestr.=''.$rs['ip'].'';
}else if(contain($_web,'xiaomi')){
}else if(contain($_web,'xiaomi') || !isempt($rs['pushtoken'])){
$nestr.=''.$rs['pushtoken'].'';
}
if(arrvalue($rs,'regid')){
$nestr.='|'.$rs['regid'].'';
$jpreg = 'yes';
$jparr[] = $rs['regid'];
}
$alias2019[] = $nestr;
if(!in_array($_uid, $uid2019))$uid2019[] = $_uid;
if($rs['ispush']=='1')$pushuids[] = $_uid;//可以手机推送的用户
}
return array('uids'=>$uids,'alias2019'=>$alias2019,'uid2019'=>$uid2019,'pushuids'=>$pushuids);
return array('uids'=>$uids,'alias2019'=>$alias2019,'uid2019'=>$uid2019,'pushuids'=>$pushuids, 'jpreg'=>$jpreg, 'jparr' => $jparr);
}
/**
@@ -1118,13 +1128,14 @@ class reimClassModel extends Model
));
//服务端返回{"zshu":2,"yfuid":"1,8","wfuid":""}
if($gbarr && $gbarr['success'] && $bstr = arrvalue($gbarr, 'data')){
$data = json_decode($bstr, true);
$yfuid= explode(',', arrvalue($data, 'yfuid'));
if($yfuid){
$data = json_decode($bstr, true);
$yfuid = arrvalue($data, 'yfuid');
if(!isempt($yfuid)){//有在线人员用了服务端推送
$yfuida = explode(',', $yfuid);
$nealas = array();
foreach($alias2019 as $alis){
$bo = false;
foreach($yfuid as $yfid){if(contain($alis,'|'.$yfid.'|'))$bo=true;};
foreach($yfuida as $yfid){if(contain($alis,'|'.$yfid.'|'))$bo=true;};
if(!$bo)$nealas[] = $alis;
}
$alias['alias2019'] = $nealas;
@@ -1132,7 +1143,6 @@ class reimClassModel extends Model
}
}
}
return c('JPush')->push($title, $pushcont, $contjson, $alias);
}
@@ -1227,6 +1237,8 @@ class reimClassModel extends Model
foreach($cans as $k=>$v)$carr[$k]=$v;
$reimtype = $this->option->getval('reimservertype');
//if($carr['atype']=='sendapp')c('JPush')->sendJpush($carr);
if($reimtype=='1')return c('rockqueue')->pushdata($carr);
$str = json_encode($carr);