发布v2.5.9版本

This commit is contained in:
雨中磐石
2023-07-12 16:27:03 +08:00
parent 17e1d6ed22
commit 983cd0d3ea
29 changed files with 551 additions and 118 deletions

View File

@@ -9,19 +9,46 @@ class crmClassModel extends Model
//读取我的客户和共享给我的
public function getmycust($uid=0, $id=0)
{
$limit = (int)$this->rock->get('limit', '10');
$page = (int)$this->rock->get('page', '1');
$key = $this->rock->get('key');
$where = '';
if($key){
$key= $this->rock->jm->base64decode($key);
$where.= " and (`name` like '%$key%' or `unitname` like '%$key%')";
}
if(isempt($id))$id = 0;
if($uid==0)$uid=$this->adminid;
$s = $this->rock->dbinstr('shateid', $uid);
$rows = $this->getrows("`status`=1 and ((`uid`='$uid') or (`id`=$id) or (".$s."))",'id as value,name,id,unitname as subname','`optdt` desc');
return $rows;
$rows = $this->getrows("`status`=1 and ((`uid`='$uid') or (`id`=$id) or (".$s.")) $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(
'rows' => $rows,
'totalCount' => $totalCount,
'limit' => $limit,
'page' => $page,
);
}
//读取所有客户
public function custdata()
{
$limit = (int)$this->rock->get('limit', '10');
$page = (int)$this->rock->get('page', '1');
$key = $this->rock->get('key');
$where = m('admin')->getcompanywhere(3);
$rows = $this->getrows("`status`=1 ".$where."",'id as value,name,id,unitname as subname','`optdt` desc');
return $rows;
if($key){
$key= $this->rock->jm->base64decode($key);
$where.= " and (`name` like '%$key%' or `unitname` like '%$key%')";
}
$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(
'rows' => $rows,
'totalCount' => $totalCount,
'limit' => $limit,
'page' => $page,
);
}

View File

@@ -108,7 +108,7 @@ class fileClassModel extends Model
if($this->isimg($ext))return true;
if($this->isoffice($ext))return true;
if($this->isyulan($ext))return true;
return contain(',mp3,ogg,mp4,', ','.$ext.',');
return contain(',mp3,ogg,mp4,amr,', ','.$ext.',');
}
//获取缩略图的路径

View File

@@ -95,6 +95,10 @@ class goodsClassModel extends Model
public function getgoodsdata($lx=0)
{
$typeid = $this->rock->get('selvalue');
$limit = (int)$this->rock->get('limit', '10');
$page = (int)$this->rock->get('page', '1');
$key = $this->rock->get('key');
$where = '1=1';
if(!isempt($typeid)){
$alltpeid = m('option')->getalldownid($typeid);
@@ -113,9 +117,17 @@ class goodsClassModel extends Model
}
$where.= ' and a.`id` in('.$aids.')';
}
$where .= m('admin')->getcompanywhere(1,'a.');
$rowss = $this->db->getall('select a.`id`,a.`name`,a.`xinghao`,a.`guige`,a.`stock`,a.`price`,a.`unit`,b.`name` as `typename` from `[Q]goods` a left join `[Q]option` b on a.`typeid`=b.`id` where '.$where.'');
$rows = array();
if($key){
$key= $this->rock->jm->base64decode($key);
$where.= " and (a.`name` like '%$key%' or a.`num` like '%$key%' or a.`xinghao` like '%$key%' or a.`guige` like '%$key%')";
}
$rowss = $this->db->getall('select SQL_CALC_FOUND_ROWS a.`id`,a.`name`,a.`xinghao`,a.`num`,a.`guige`,a.`stock`,a.`price`,a.`unit`,b.`name` as `typename` from `[Q]goods` a left join `[Q]option` b on a.`typeid`=b.`id` where '.$where.' limit '.(($page-1)*$limit).','.$limit.'');
$totalCount = $this->db->found_rows();
$rows = array();
foreach($rowss as $k=>$rs){
$name = $rs['name'];
if(!isempt($rs['xinghao']))$name.='('.$rs['xinghao'].')';
@@ -126,10 +138,11 @@ class goodsClassModel extends Model
$baar = array(
'name' => $name,
'value' => $rs['id'],
'num' => $rs['num'],
'price' => $rs['price'],
'unit' => $rs['unit'],
'stock' => $stock,
'subname' => $rs['typename'],
'subname' => $rs['num'].' '.$rs['typename'],
);
if(($lx==1 || $lx==3) && $stock<='0'){
$baar['disabled']= true;//领用没有库存了
@@ -141,7 +154,10 @@ class goodsClassModel extends Model
$selectdata = $this->getgoodstype(1);
return array(
'rows' => $rows,
'selectdata'=>$selectdata
'selectdata'=>$selectdata,
'totalCount'=>$totalCount,
'page' => $page,
'limit' => $limit,
);
}

View File

@@ -26,7 +26,7 @@ class loginClassModel extends Model
$yanzm = $this->rock->request('yanzm');//验证码
$ltype = (int)$this->rock->request('ltype',0);//登录类型1是手机+验证码
if(!isempt($yanzm) && strlen($yanzm)!=6)return '验证码必须是6位数字';
$cfroar= explode(',', 'pc,reim,weixin,appandroid,mweb,webapp,nppandroid,nppios');
$cfroar= explode(',', 'pc,reim,weixin,appandroid,mweb,webapp,nppandroid,nppios,nppiosnew');
if(!in_array($cfrom, $cfroar))return 'not found cfrom['.$cfrom.']';
if($user=='')return '用户名不能为空';
if($pass==''&&strlen($token)<8 && $ltype==0)return '密码不能为空';

View File

@@ -1061,34 +1061,29 @@ class reimClassModel extends Model
}
}
$uwhere = "$where `status`=1";
$rows = m('logintoken')->getrows("`uid` in(select id from `[Q]admin` where $uwhere) and `cfrom` in ('appandroid','nppandroid','nppios') and `online`=1",'*','id desc');
$alias = $uida = $xmalias = $oldalias = $pushuids = $newalias = $alias2019 = $uid2019 =array();
$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();
$uids = '0';
$times = date('Y-m-d H:i:s', time()-5*60);//5分钟
foreach($rows as $k=>$rs){
$_uid = $rs['uid'];
$_web = $rs['web'];
//if(in_array($_uid, $uida))continue;
$uida[] = $_uid;
$uids .= ','.$_uid.'';
if($_web=='xiaomi'){
$xmalias[] = $rs['token'];
}else if(in_array($rs['cfrom'], array('nppandroid','nppios'))){//2019-11-25最新新app
$nestr = ''.$rs['token'].'|'.$rs['web'].'|'.$_uid.'|';
if(contain($rs['web'],'huawei') && !contain($rs['ip'],'.'))$nestr.=''.$rs['ip'].'';
if(contain($rs['web'],'xiaomi'))$nestr.=''.$rs['pushtoken'].'';
$alias2019[] = $nestr;
$uid2019[] = $_uid;
}else if(substr($_web,0,4)=='app_'){
$newalias[] = $rs['token'];
}else if(substr($_web,0,4)=='apk_'){
$oldalias[] = $rs['token'];
}else{
$alias[] = $rs['token'];
$nestr = ''.$rs['token'].'|'.$_web.'|'.$_uid.'|';
if(contain($_web,'getui')){
$nestr.=''.$rs['pushtoken'].''; //个推
}else if(contain($_web,'huawei') && !contain($rs['ip'],'.')){
$nestr.=''.$rs['ip'].'';
}else if(contain($_web,'xiaomi')){
$nestr.=''.$rs['pushtoken'].'';
}
$alias2019[] = $nestr;
if(!in_array($_uid, $uid2019))$uid2019[] = $_uid;
if($rs['ispush']=='1')$pushuids[] = $_uid;//可以手机推送的用户
}
return array('alias' => $alias, 'uids'=>$uids, 'xmalias'=>$xmalias, 'oldalias'=>$oldalias, 'newalias'=>$newalias,'alias2019'=>$alias2019,'uid2019'=>$uid2019,'pushuids'=>$pushuids);
return array('uids'=>$uids,'alias2019'=>$alias2019,'uid2019'=>$uid2019,'pushuids'=>$pushuids);
}
/**