Skip to content

Commit

Permalink
72crm_9.0_20190605升级日志
Browse files Browse the repository at this point in the history
72crm_9.0_20190605升级日志

下载跟新包,执行更新SQL(update_sql)语句
新增:
1、	跟进记录类型增加自定义设置
2、	联系人、商机之间可以相互“关联”和“解除关联”
3、	增加回款计划增加编辑、删除功能
4、	合同到期提醒天数自定义设置,合同提醒不启用时,待办事项中不显示
5、	增加公海导出功能
6、	增加了重置登录账号功能

优化:
1、	成交状态改成可以编辑
2、客户管理列表,点击查看某条数据详情时,列表增加蓝色线标识
3、跟进记录、日志、任务描述中的输入框可以按“enter”键换行,保存提交之后还保持换行状态
4、合同详情回款列表增加“回款期数”字段
5、增加在系统菜单导航栏点击鼠标右键“在新标签页中打开链接”
6、导入导出的请求超时时间设置为1分钟
7、客户管理-列表页点击蓝色字体才能查看对应数据详情
8、办公板块优化了用户体验

修复:
1、	合同高级筛选,选择“审核状态不等于已撤回”时,筛选出来的都是已撤回的
2、	合同中增加多条回款计划,在列表中会显示多条合同数据
3、客户自定义字段添加“多选”类型字段后,删除系统默认的第一个选项后保存,添加客户时,删除的第一个选项成了该字段的默认值
4、普通员工查看公告详情提示“无权操作”
  • Loading branch information
WukongSoftware committed Jun 5, 2019
1 parent 9646095 commit 75fb1cd
Show file tree
Hide file tree
Showing 226 changed files with 3,614 additions and 511 deletions.
9 changes: 7 additions & 2 deletions application/admin/controller/ApiCommon.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,13 @@ public function _initialize()
$header = Request::instance()->header();

$authKey = $header['authkey'];
$sessionId = $header['sessionid'];
$cache = cache('Auth_'.$authKey);
$sessionId = $header['sessionid'];
// $is_mobile = $header['is_mobile'];
// if ($is_mobile) {
// $cache = cache('Auth_'.$authKey.'_mobile');
// } else {
$cache = cache('Auth_'.$authKey);
// }
// 校验sessionid和authKey
if (empty($sessionId) || empty($authKey) || empty($cache)) {
header('Content-Type:application/json; charset=utf-8');
Expand Down
2 changes: 1 addition & 1 deletion application/admin/controller/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function login()
$password = $param['password'];
$verifyCode = !empty($param['verifyCode'])? $param['verifyCode']: '';
$isRemember = !empty($param['isRemember'])? $param['isRemember']: '';
$is_mobile = $param['is_mobile'] ? : '';
$is_mobile = $param['mobile'] ? : '';
$data = $userModel->login($username, $password, $verifyCode, $isRemember, $type, $authKey, $is_mobile);

Session::set('user_id', $data['userInfo']['id']);
Expand Down
4 changes: 2 additions & 2 deletions application/admin/controller/Groups.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function _initialize()
{
$action = [
'permission'=>[''],
'allow'=>['index','read','save','update','delete','deletes','enables','copy']
'allow'=>['index','read','save','update','delete','enables','copy']
];
Hook::listen('check_auth',$action);
$request = Request::instance();
Expand Down Expand Up @@ -127,7 +127,7 @@ public function delete()
if ($dataInfo['types']) {
return resultArray(['error' => '系统角色,不能删除']);
}
$data = $groupModel->delDataById($param['id']);
$data = $groupModel->delGroupById($param['id']);
if (!$data) {
return resultArray(['error' => $groupModel->getError()]);
}
Expand Down
47 changes: 45 additions & 2 deletions application/admin/controller/Users.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function _initialize()
parent::_initialize();
$action = [
'permission'=>[],
'allow'=>['index','save','update','updatepwd','enables','read','getuserlist','updateimg','resetpassword','userlistbystructid','groups','groupsdel','tobeusers','structureuserlist','getuserlist']
'allow'=>['index','save','update','updatepwd','enables','read','getuserlist','updateimg','resetpassword','userlistbystructid','groups','groupsdel','tobeusers','structureuserlist','getuserlist','usernameedit']
];
Hook::listen('check_auth',$action);

Expand Down Expand Up @@ -246,8 +246,15 @@ public function updateImg()
public function resetPassword()
{
$param = $this->param;
$userInfo = $this->userInfo;
$userModel = model('User');
if ($param['id'] && $param['id'] !== $userInfo['id']) {
if ($param['id'] && (int)$param['id'] !== $userInfo['id']) {
//权限判断
$adminTypes = adminGroupTypes($userInfo['id']);
if (!in_array(3,$adminTypes) && !in_array(1,$adminTypes) && !in_array(2,$adminTypes)) {
header('Content-Type:application/json; charset=utf-8');
exit(json_encode(['code'=>102,'error'=>'无权操作']));
}
$user_id = $param['id'];
if (!$param['new_pwd']) {
$this->error = '请输入重置密码';
Expand Down Expand Up @@ -388,4 +395,40 @@ public function userListByStructId()
$ret = $usermodel->getUserListByStructureId($structure_id) ? : [];
return resultArray(['data'=>$ret]);
}

/**
* 员工账号修改
* @param
* @return
*/
public function usernameEdit()
{
$param = $this->param;
$userInfo = $this->userInfo;
//权限判断
$adminTypes = adminGroupTypes($userInfo['id']);
if (!in_array(3,$adminTypes) && !in_array(1,$adminTypes) && !in_array(2,$adminTypes)) {
header('Content-Type:application/json; charset=utf-8');
exit(json_encode(['code'=>102,'error'=>'无权操作']));
}
if (!$param['id'] || !$param['username'] || !$param['password']) {
return resultArray(['error' => '参数错误!']);
}
if (db('admin_user')->where(['id' => ['neq',$param['id']],'username' => $param['username']])->find()) {
return resultArray(['error' => '手机号码已存在!']);
}
$userData = db('admin_user')->where(['id' => $param['id']])->field('username,salt,password')->find();
$data = [];
$data['username'] = $param['username'];
$data['password'] = user_md5($param['password'], $userData['salt'], $param['username']);
$data['userInfo'] = $userData;
$resSync = model('Sync')->syncData($data);
if ($resSync) {
unset($data['userInfo']);
$res = db('admin_user')->where(['id' => $param['id']])->update($data);
return resultArray(['data' => '修改成功!']);
} else {
return resultArray(['error' => '修改失败,请重试!']);
}
}
}
2 changes: 1 addition & 1 deletion application/admin/model/Common.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ protected function fmtRequest( $request = [] )
unset($request['limit']);
}
if ($pageType == 'all') {
$page = 0;
$page = 1;
$limit = 0;
unset($request['pageType']);
}
Expand Down
3 changes: 2 additions & 1 deletion application/admin/model/Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,8 @@ public function field($param, $dataInfo = [])
$travelList = db('oa_examine_travel')->where($whereTravel)->select() ? : [];
foreach ($travelList as $key=>$val) {
$where = [];
$fileList = [];
$imgList = [];
$where['module'] = 'oa_examine_travel';
$where['module_id'] = $val['travel_id'];
$newFileList = [];
Expand Down Expand Up @@ -688,7 +690,6 @@ public function field($param, $dataInfo = [])
$field_list[$k]['setting'] = $setting;
$field_list[$k]['default_value'] = $default_value;
$field_list[$k]['value'] = $value;
$field_list[$k]['width'] = $resIndexField[$v['field']]['width'] ? : '';
}
}
return $field_list ? : [];
Expand Down
2 changes: 1 addition & 1 deletion application/admin/model/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class File extends Common
* @param $x 裁剪图的长 ,$y 裁剪图的宽
* @return [array]
*/
public function createData($files, $param, $x = '150', $y = '150')
public function createData($files, $param = [], $x = '150', $y = '150')
{
if (empty($files)) {
$this->error = '请选择上传文件';
Expand Down
2 changes: 1 addition & 1 deletion application/admin/model/Group.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public function updateDataById($param,$group_id)
}

//删除角色
public function delDataById($group_id)
public function delGroupById($group_id = '')
{
$dataInfo = $this->get($group_id);
if(!$dataInfo){
Expand Down
1 change: 1 addition & 0 deletions application/admin/model/Rule.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public function getDataList($param)
$cat = new \com\Category('admin_rule', array('id', 'pid', 'title', 'title'));
$data = $cat->getList('', 0, 'id');
foreach ($data as $k => $v) {
if ($v['id'] == '31') unset($data[$k]); continue;
$data[$k]['check'] = false;
if ($types && !in_array((int)$v['types'], $types)) {
unset($data[$k]);
Expand Down
2 changes: 1 addition & 1 deletion application/admin/model/Scene.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public function getDataList($types, $user_id)
* @param array $param [description]
* @author Michael_xu
*/
public function getDataById($id = '', $user_id, $types = '')
public function getDataById($id = '', $user_id = '', $types = '')
{
$where = [];
$where['scene_id'] = $id;
Expand Down
2 changes: 1 addition & 1 deletion application/admin/model/Sync.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
// +----------------------------------------------------------------------
// | Description: 同步
// | Description:
// +----------------------------------------------------------------------
// | Author: Michael_xu | gengxiaoxu@5kcrm.com
// +----------------------------------------------------------------------
Expand Down
12 changes: 6 additions & 6 deletions application/admin/model/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public function getDataList($request)
->alias('user')
->join('__ADMIN_STRUCTURE__ structure', 'structure.id = user.structure_id', 'LEFT')
->join('HrmUserDet hud','hud.user_id = user.id','LEFT')
->page( $request['page'], $request['limit'])
->limit(($request['page']-1)*$request['limit'], $request['limit'])
->where($map)
->field('user.id,user.username,user.img,user.thumb_img,user.realname,user.num,user.email,user.mobile,user.sex,user.structure_id,user.post,user.status,user.parent_id,user.type,user.create_time,structure.name as s_name')
->order($exp)
Expand Down Expand Up @@ -427,13 +427,13 @@ public function login($username, $password, $verifyCode = '', $isRemember = fals
// $info['_AUTH_LIST_'] = $dataList['rulesList'];
$info['authKey'] = $authKey;
//手机登录
if ($mobile == 1) {
cache('Auth_'.$userInfo['authkey'].'mobile', NULL);
cache('Auth_'.$authKey.'mobile', $info, $loginExpire);
} else {
// if ($mobile == 1) {
// cache('Auth_'.$userInfo['authkey'].'_mobile', NULL);
// cache('Auth_'.$authKey.'_mobile', $info, $loginExpire);
// } else {
cache('Auth_'.$userInfo['authkey'], NULL);
cache('Auth_'.$authKey, $info, $loginExpire);
}
// }
unset($userInfo['authkey']);

// 返回信息
Expand Down
2 changes: 1 addition & 1 deletion application/bi/model/Contacts.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Contacts extends Common
*/
function getSortByCount($whereArr)
{
$count = db('crm_contacts')->group('owner_user_id')->field('owner_user_id,count(contacts_id) as count')->where($whereArr)->select();
$count = db('crm_contacts')->group('owner_user_id')->field('owner_user_id,count(contacts_id) as count')->order('count desc')->where($whereArr)->select();
return $count;
}
}
42 changes: 12 additions & 30 deletions application/bi/model/Customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,7 @@ function getStartAndEnd($param,$year,$i)
$timeArr['next_month'] = 1;
}
$timeArr['type'] = $year.'-'.$month+$i-1;
}

}
break;
case 'month'://本月
$timeArr['year'] = $year;
Expand All @@ -150,23 +149,7 @@ function getStartAndEnd($param,$year,$i)
}else{
$timeArr['next_month'] = date('m')+1;
$timeArr['next_day'] = 1;
}
// if($i != date("t")){
// $timeArr['day'] = $i;
// $timeArr['next_day'] = $i+1;
// $timeArr['month'] = date('m');
// $timeArr['next_month'] = date('m');
// }else{
// $timeArr['day'] = $i;
// $timeArr['next_day'] = 1;
// $timeArr['month'] = date('m');
// if(date('m') != 12){
// $timeArr['next_month'] = date('m')+1;
// }else{
// $timeArr['next_month'] = 1;
// $timeArr['next_year'] = $year+1;
// }
// }
}
$timeArr['type'] = $year.'-'.date('m').'-'.$i;
break;
case 'lastMonth'://上月
Expand Down Expand Up @@ -248,10 +231,10 @@ function getStartAndEnd($param,$year,$i)
$timeArr['type'] = $year.'-'.date("m",$today).'-'.date("d",$today);
break;
case 'month_k'://跨月
$start_time_y = date('y',strtotime($param['start_time']));
$start_time_y = date('y',$param['start_time']);
$timeArr['year'] = $start_time_y;
$timeArr['next_year'] = $start_time_y;
$m = date('m',strtotime($start_time));
$m = date('m',$param['start_time']);
if($i > 1){
$timeArr['month'] = $m+$i-1;
$timeArr['next_month'] = $m+$i;
Expand All @@ -266,11 +249,11 @@ function getStartAndEnd($param,$year,$i)
$start_time = $param['start_time'];
$end_time = $param['end_time'];

$start_y = date('y',strtotime($start_time));
$start_m = date('m',strtotime($start_time));
$start_d = date('d',strtotime($start_time));
$start_y = date('y',$start_time);
$start_m = date('m',$start_time);
$start_d = date('d',$start_time);

$monthNum = $this->getMonthNum(strtotime($start_time),strtotime($end_time));
$monthNum = $this->getMonthNum($start_time,$end_time);
$y = ceil(($start_m+$i-1)/12);
if(($start_m+$i-1)/12 <= $y){
if($i == 1){
Expand Down Expand Up @@ -305,9 +288,8 @@ function getStartAndEnd($param,$year,$i)
}
break;
default ://自定义时间
$start_time = strtotime($param['start_time']);
$end_time = strtotime($param['end_time']);

$start_time = $param['start_time'];
$end_time = $param['end_time'];
$start_time_y = date('y',$start_time);
$start_time_m = date('m',$start_time);
$end_time_y = date('y',$end_time);
Expand Down Expand Up @@ -379,8 +361,8 @@ function getParamByCompany($param)
$company['j'] = 1;
break;
default ://自定义时间
$start_time = strtotime($param['start_time']);
$end_time = strtotime($param['end_time']);
$start_time = $param['start_time'];
$end_time = $param['end_time'];
$company['start_time_y'] = $start_time_y = date('y',$start_time);
$start_time_m = date('m',$start_time);
$end_time_y = date('y',$end_time);
Expand Down
1 change: 1 addition & 0 deletions application/bi/model/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ function getSortByProduct($request)
->alias('a')
->where($where)
->join($join)
->order('num desc')
->group('contract.owner_user_id')
->field('sum(a.num) as num,contract.owner_user_id')
->select();
Expand Down
2 changes: 1 addition & 1 deletion application/bi/model/Record.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,6 @@ function getSortByCustomer($whereArr)
$where['create_user_id'] = array('eq',$value['create_user_id']);
$list[$key]['count'] = count(db('admin_record')->group('types_id')->field('count(types_id) as count')->order('count desc')->where($where)->select());
}
return $list;
return sort_select($list,'count');
}
}
13 changes: 7 additions & 6 deletions application/common.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
error_reporting(E_ERROR | E_PARSE );
/**
* 行为绑定
*/
Expand Down Expand Up @@ -156,7 +157,7 @@ function where_arr($array = [], $m = '', $c = '', $a = '')
$k = 'name';
$c = 'contacts.';
}
if ($k == 'check_status' && is_array($v)) $v = $checkStatusArray[$v['value']] ? : $v;
if ($k == 'check_status' && is_array($v)) $v['value'] = $checkStatusArray[$v['value']] ? : '0';
if (is_array($v)) {
if ($v['state']) {
$address_where[] = '%'.$v['state'].'%';
Expand Down Expand Up @@ -188,7 +189,7 @@ function where_arr($array = [], $m = '', $c = '', $a = '')
} else {
$where[$c.$k] = ['elt', $v['end_date']];
}
} elseif (!empty($v['value'])) {
} elseif (!empty($v['value']) || $v['value'] === '0') {
if (in_array($k, $check_field_arr)) {
$where[$c.$k] = field($v['value'], 'contains');
} else {
Expand Down Expand Up @@ -449,7 +450,7 @@ function getSubUser($userId)
if ($sub_user) {
foreach ($sub_user as $v) {
$son_user = [];
$son_user = getSubUser($v, $sub);
$son_user = getSubUser($v);
if (!empty($son_user)) {
$sub_user = array_merge($sub_user, $son_user);
}
Expand Down Expand Up @@ -858,8 +859,8 @@ function getTimeBySec($time){
*/
function getmonthByYM($param)
{
$month = $param['month']?$param['month']:1; date('m',$time);
$year = $param['year']?$param['year']:date('Y',$time);
$month = $param['month'] ? $param['month'] : date('m',time());
$year = $param['year'] ? $param['year'] : date('Y',time());
if (in_array($month, array('1', '3', '5', '7', '8', '01', '03', '05', '07', '08', '10', '12'))) {
$days = '31';
} elseif ($month == 2) {
Expand Down Expand Up @@ -1355,8 +1356,8 @@ function setting($data)
foreach($options as $v){
$v = trim(str_replace(chr(13),'',trim($v)));
if($v != '' && !in_array($v ,$s)){
$i++;
$setting .= "$i=>'$v',";
$i++;
$s[] = $v;
}
}
Expand Down
10 changes: 7 additions & 3 deletions application/common/behavior/AuthenticateBehavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,19 @@ public function run(&$params)
$a = strtolower($request->action());
//提交方式拦截
$scan = new \com\Scan();
$response = $scan->webscan_Check();
$response = $scan->webscan_Check();

$allow = $params['allow']; //登录用户可访问
$permission = $params['permission']; //无限制
/*获取头部信息*/
$header = $request->header();
$authKey = $header['authkey'];
$cache = cache('Auth_'.$authKey);

// $is_mobile = $header['is_mobile'];
// if ($is_mobile) {
// $cache = cache('Auth_'.$authKey.'_mobile');
// } else {
$cache = cache('Auth_'.$authKey);
// }
$userInfo = $cache['userInfo'];

if (in_array($a, $permission)) {
Expand Down

0 comments on commit 75fb1cd

Please sign in to comment.