Skip to content

Commit

Permalink
72crm_9.0.1_20190510
Browse files Browse the repository at this point in the history
修复:

1、产品无法导入

2、权限配置问题

3、修复商机添加沟通记录问题

3、其他已知BUG
  • Loading branch information
WukongSoftware committed May 11, 2019
1 parent ced9614 commit 9c6c0b1
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion application/admin/controller/Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function _initialize()
}
$userInfo = $this->userInfo;
//权限判断
$unAction = ['getfield','read','config','validates','configindex','columnwidth'];
$unAction = ['getfield','read','config','validates','configindex','columnwidth','uniquefield'];
$adminTypes = adminGroupTypes($userInfo['id']);
if (!in_array(6,$adminTypes) && !in_array(1,$adminTypes) && !in_array(2,$adminTypes) && !in_array($a, $unAction)) {
header('Content-Type:application/json; charset=utf-8');
Expand Down
2 changes: 1 addition & 1 deletion application/admin/controller/Users.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public function update()
$userData = db('admin_user')->where(['id' => $param['id']])->find();
if (!$param['id']) {
//修改个人信息
$param['user_id'] = $userData['id'];
$param['user_id'] = $userInfo['id'];
} else {
//权限判断
$adminTypes = adminGroupTypes($userInfo['id']);
Expand Down
2 changes: 1 addition & 1 deletion application/admin/model/Record.php
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ public function updateNexttime($types, $types_id, $next_time)
$data = [];
if ($next_time) $data['next_time'] = $next_time;
$data['update_time'] = time();
$data['follow'] = '已跟进';
if (in_array($types,['crm_customer','crm_leads'])) $data['follow'] = '已跟进';
$dbName->where([$dbId => $types_id])->update($data);
return true;
}
Expand Down
9 changes: 4 additions & 5 deletions application/admin/model/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,14 +287,14 @@ public function updateDataById($param, $id)
//修改个人信息
$data['email'] = $param['email'];
$data['sex'] = $param['sex'];
$data['mobile'] = $param['username'];
// $data['mobile'] = $param['username'];
if (db('admin_user')->where(['username' => $param['username'],'id' => ['neq',$param['user_id']]])->find()) {
$this->error = '手机号已存在';
return false;
}
Db::name('HrmUserDet')->where(['user_id' => $param['user_id']])->update($data);
$data['realname'] = $param['realname'];
$data['username'] = $param['username'];
// $data['username'] = $param['username'];
$flag = $this->where(['id' => $param['user_id']])->update($data);
if ($flag) {
return true;
Expand Down Expand Up @@ -326,7 +326,7 @@ public function updateDataById($param, $id)
$this->error = '手机号已存在';
return false;
}

$this->startTrans();
try {
$accessModel = model('Access');
Expand All @@ -341,8 +341,7 @@ public function updateDataById($param, $id)
$this->allowField(true)->save($param, ['id' => $id]);
$this->commit();

$data['user_id'] = $id;
$data['mobile'] = $param['username'];
// $data['mobile'] = $param['username'];
$data['email'] = $param['email'];
$data['sex'] = $param['sex'];
$data['update_time'] = time();
Expand Down
1 change: 1 addition & 0 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
14 changes: 9 additions & 5 deletions application/crm/model/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,12 @@ public function createData($param)

//产品分类
$category_id = $param['category_id'];
$param['category_id'] = $productCategoryModel->getIdByStr($category_id);
$param['category_str'] = arrayToString($category_id);
if (is_array($category_id)) {
$param['category_id'] = $productCategoryModel->getIdByStr($category_id);
$param['category_str'] = arrayToString($category_id);
}

if ($this->data($param)->allowField(true)->save()) {
if ($this->data($param)->allowField(true)->isUpdate(false)->save()) {
$data = [];
$data['product_id'] = $this->product_id;
return $data;
Expand Down Expand Up @@ -192,8 +194,10 @@ public function updateDataById($param, $product_id = '')

//产品分类
$category_id = $param['category_id'];
$param['category_id'] = $productCategoryModel->getIdByStr($category_id);
$param['category_str'] = arrayToString($category_id);
if (is_array($category_id)) {
$param['category_id'] = $productCategoryModel->getIdByStr($category_id);
$param['category_str'] = arrayToString($category_id);
}

if ($this->allowField(true)->save($param, ['product_id' => $product_id])) {
//修改记录
Expand Down

0 comments on commit 9c6c0b1

Please sign in to comment.