no commit message
This commit is contained in:
@@ -794,15 +794,15 @@ class adminClassModel extends Model
|
||||
|
||||
public function getcompanyid($uid=0)
|
||||
{
|
||||
$comid = (int)$this->rock->session('companyid','0');
|
||||
if($comid==0)$comid = $this->getcompanyinfo($uid,2);
|
||||
//$comid = (int)$this->rock->session('companyid','0');
|
||||
$comid = $this->getcompanyinfo($uid,2);
|
||||
if(!$comid)$comid=1;
|
||||
return $comid;
|
||||
}
|
||||
|
||||
public function setcompanyid($comid)
|
||||
{
|
||||
$this->rock->setsession('companyid', $comid);
|
||||
//$this->rock->setsession('companyid', $comid);
|
||||
return $comid;
|
||||
}
|
||||
|
||||
|
||||
@@ -32,14 +32,18 @@ class flow_carmreseClassModel extends flowModel
|
||||
//可预定的车辆
|
||||
public function getcardata()
|
||||
{
|
||||
$where= $this->adminmodel->getcompanywhere(1);
|
||||
$rows = m('carm')->getall("`ispublic`=1 and `state`=1 ".$where."",'carnum as name,id as value');
|
||||
$arrs = $this->db->getrows('[Q]carmrese','`status`=1 group by carid','max(kmend)kmend,carid');
|
||||
$arrsa= array();
|
||||
foreach($arrs as $k=>$rs)$arrsa[$rs['carid']]=$rs['kmend'];
|
||||
$where = $this->adminmodel->getcompanywhere(1);
|
||||
$rows = m('carm')->getall("`ispublic`=1 and `state`=1 ".$where."",'carnum as name,id as value');
|
||||
$db = m('carmrese');
|
||||
//读取车辆最后公里数
|
||||
foreach($rows as $k=>$rs){
|
||||
$rows[$k]['kmstart'] = $this->rock->arrvalue($arrsa, $rs['value']);
|
||||
$onrs = $db->getone("`status`=1 and `carid`=".$rs['value']." and ifnull(`kmend`,'')<>''", '`kmend`,`kmstart`','`kmend` desc');
|
||||
$km = '';
|
||||
if($onrs){
|
||||
$km = $onrs['kmend'];
|
||||
if(isempt($km))$km = $onrs['kmstart'];
|
||||
}
|
||||
$rows[$k]['kmstart'] = $km;
|
||||
}
|
||||
return $rows;
|
||||
}
|
||||
|
||||
54
webmain/model/flow/custpriceModel.php
Normal file
54
webmain/model/flow/custpriceModel.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
class flow_custpriceClassModel extends flowModel
|
||||
{
|
||||
public $minwidth = 600;//子表最小宽
|
||||
|
||||
public $goodsobj;
|
||||
|
||||
public function initModel()
|
||||
{
|
||||
$this->goodsobj = m('goods');
|
||||
}
|
||||
|
||||
public function flowxiangfields(&$fields)
|
||||
{
|
||||
$fields['base_name'] = '报价人';
|
||||
$fields['base_deptname'] = '报价人部门';
|
||||
$fields['base_sericnum'] = '报价单号';
|
||||
return $fields;
|
||||
}
|
||||
|
||||
public function flowsearchfields()
|
||||
{
|
||||
$arr[] = array('name'=>'报价人...','fields'=>'uid');
|
||||
return $arr;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//子表数据替换处理
|
||||
protected function flowsubdata($rows, $lx=0){
|
||||
$db = m('goods');
|
||||
foreach($rows as $k=>$rs){
|
||||
$one = $db->getone($rs['aid']);
|
||||
if($one){
|
||||
$name = $one['name'];
|
||||
if(!isempt($one['xinghao']))$name.='('.$one['xinghao'].')';
|
||||
if($lx==1)$rows[$k]['aid'] = $name; //1展示时
|
||||
$rows[$k]['temp_aid'] = $name;
|
||||
}
|
||||
}
|
||||
return $rows;
|
||||
}
|
||||
|
||||
//$lx,0默认,1详情展示,2列表显示
|
||||
public function flowrsreplace($rs, $lx=0)
|
||||
{
|
||||
//读取物品
|
||||
if($lx==2){
|
||||
$rs['wupinlist'] = $this->goodsobj->getgoodninfo($rs['id'], 1);
|
||||
}
|
||||
return $rs;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -111,7 +111,14 @@ class flow_custractClassModel extends flowModel
|
||||
$arr['type'] = $this->rs['type'];
|
||||
$arr['explain'] = $arrs['sm'];
|
||||
$arr['money'] = $money;
|
||||
m('custfina')->insert($arr);
|
||||
$newid = m('custfina')->insert($arr);
|
||||
|
||||
if($this->rs['type']=='0'){
|
||||
m('flow')->submit('custfina', $newid, '提交');
|
||||
}else{
|
||||
m('flow')->submit('custfinb', $newid, '提交');
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -219,7 +219,7 @@ class flow_hrsalaryClassModel extends flowModel
|
||||
}
|
||||
|
||||
//导入之前判断
|
||||
public function flowdaorubefore($rows)
|
||||
public function flowdaorubefore($rows, &$errdata)
|
||||
{
|
||||
$inarr = array();
|
||||
$uarra = array();
|
||||
@@ -231,10 +231,16 @@ class flow_hrsalaryClassModel extends flowModel
|
||||
|
||||
$arr = $rs;
|
||||
$urs = $this->adminmodel->getone("`name`='$name'");
|
||||
if(!$urs)continue;
|
||||
if(!$urs){
|
||||
$errdata[$rs['drxu']] = '('.$name.')用户不存在';
|
||||
continue;
|
||||
}
|
||||
|
||||
$to = $this->rows("`xuid`='".$urs['id']."' and `month`='$month'");
|
||||
if($to>0)continue;//已经存在了
|
||||
if($to>0){
|
||||
$errdata[$rs['drxu']] = '('.$name.'的'.$month.')已经存在了';
|
||||
continue;//已经存在了
|
||||
}
|
||||
|
||||
$arr['month'] = $month;
|
||||
$arr['xuid'] = $urs['id'];
|
||||
|
||||
@@ -205,7 +205,9 @@ class flow_userClassModel extends flowModel
|
||||
//读取部门Id
|
||||
$deptarr = $this->getdeptid($rs['deptname'], $dbs);
|
||||
|
||||
if($deptarr['deptid']==0)return '行'.($k+1).'找不到顶级部门['.$rs['deptname'].'],请写完整部门路径如:'.$dname.'/'.$rs['deptname'].'';
|
||||
if($deptarr['deptid']==0){
|
||||
$arr['drerr'] = '找不到顶级部门['.$rs['deptname'].'],请写完整部门路径如:'.$dname.'/'.$rs['deptname'].'';
|
||||
}
|
||||
|
||||
foreach($deptarr as $k1=>$v1)$arr[$k1]=$v1;
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ class goodsClassModel extends Model
|
||||
public function getdaishu()
|
||||
{
|
||||
$where = m('admin')->getcompanywhere(1);
|
||||
return $this->db->rows('`[Q]goodm`','`status`=1 and `state`<>1 '.$where.'');
|
||||
return $this->db->rows('`[Q]goodm`','`status`=1 and `type`<>6 and `state`<>1 '.$where.'');
|
||||
}
|
||||
|
||||
//判断是否存在相同库存
|
||||
|
||||
@@ -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,nppiosnew');
|
||||
$cfroar= explode(',', 'pc,reim,weixin,appandroid,mweb,webapp,nppandroid,nppios,nppiosnew,androidapp');
|
||||
if(!in_array($cfrom, $cfroar))return 'not found cfrom['.$cfrom.']';
|
||||
if($user=='')return '用户名不能为空';
|
||||
if($pass==''&&strlen($token)<8 && $ltype==0)return '密码不能为空';
|
||||
|
||||
Reference in New Issue
Block a user