|
|
@ -390,10 +390,10 @@ class Field extends Model
|
|
|
|
if ($v['form_type'] == 'checkbox') {
|
|
|
|
if ($v['form_type'] == 'checkbox') {
|
|
|
|
$list[$k]['default_value'] = $v['default_value'] ? explode(',', $v['default_value']) : array();
|
|
|
|
$list[$k]['default_value'] = $v['default_value'] ? explode(',', $v['default_value']) : array();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ($v['form_type']=='date_interval') {
|
|
|
|
if ($v['form_type'] == 'date_interval') {
|
|
|
|
$list[$k]['default_value'] = !empty($v['default_value']) ? explode(',',$v['default_value']) : [];
|
|
|
|
$list[$k]['default_value'] = !empty($v['default_value']) ? explode(',', $v['default_value']) : [];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if($v['form_type']=='position'){
|
|
|
|
if ($v['form_type'] == 'position') {
|
|
|
|
$list[$k]['default_value'] = !empty($v['default_value']) ? json_decode($v['default_value'], true) : [];
|
|
|
|
$list[$k]['default_value'] = !empty($v['default_value']) ? json_decode($v['default_value'], true) : [];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ($v['form_type'] == 'detail_table') {
|
|
|
|
if ($v['form_type'] == 'detail_table') {
|
|
|
@ -485,7 +485,10 @@ class Field extends Model
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//生成字段名
|
|
|
|
//生成字段名
|
|
|
|
if (!$data['field']) $data['field'] = $this->createField($types, $types == 'oa_examine' ? 'oa_' : 'crm_');
|
|
|
|
if (!empty($param['field'])) {
|
|
|
|
|
|
|
|
$data['field'] = $param['field'];
|
|
|
|
|
|
|
|
} else if (!$data['field']) $data['field'] = $this->createField($types, $types == 'oa_examine' ? 'oa_' : 'crm_');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$rule = [
|
|
|
|
$rule = [
|
|
|
|
'field' => ['regex' => '/^[a-z]([a-z]|_)+[a-z]$/i'],
|
|
|
|
'field' => ['regex' => '/^[a-z]([a-z]|_)+[a-z]$/i'],
|
|
|
@ -713,8 +716,8 @@ class Field extends Model
|
|
|
|
$new_default_value[] = str_replace(',', ',', $v);
|
|
|
|
$new_default_value[] = str_replace(',', ',', $v);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$data['default_value'] = implode(',', $new_default_value);
|
|
|
|
$data['default_value'] = implode(',', $new_default_value);
|
|
|
|
}elseif($data['default_value'] && $data['form_type'] == 'select' && !empty($data['default_value'])){
|
|
|
|
} elseif ($data['default_value'] && $data['form_type'] == 'select' && !empty($data['default_value'])) {
|
|
|
|
$data['default_value'] = $data['default_value'];
|
|
|
|
$data['default_value'] = $data['default_value'];
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$data['default_value'] = '';
|
|
|
|
$data['default_value'] = '';
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -760,12 +763,12 @@ class Field extends Model
|
|
|
|
// 数值范围
|
|
|
|
// 数值范围
|
|
|
|
if (!empty($data['minNumRestrict'])) {
|
|
|
|
if (!empty($data['minNumRestrict'])) {
|
|
|
|
$data['min_num_restrict'] = $data['minNumRestrict'];
|
|
|
|
$data['min_num_restrict'] = $data['minNumRestrict'];
|
|
|
|
}else{
|
|
|
|
} else {
|
|
|
|
$data['min_num_restrict']='';
|
|
|
|
$data['min_num_restrict'] = '';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!empty($data['maxNumRestrict'])){
|
|
|
|
if (!empty($data['maxNumRestrict'])) {
|
|
|
|
$data['max_num_restrict'] = $data['maxNumRestrict'];
|
|
|
|
$data['max_num_restrict'] = $data['maxNumRestrict'];
|
|
|
|
}else{
|
|
|
|
} else {
|
|
|
|
$data['max_num_restrict'] = '';
|
|
|
|
$data['max_num_restrict'] = '';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 清除坐标
|
|
|
|
// 清除坐标
|
|
|
@ -978,7 +981,7 @@ class Field extends Model
|
|
|
|
if (!$resData) {
|
|
|
|
if (!$resData) {
|
|
|
|
$delMessage[] = $dataInfo['name'] . ',删除失败';
|
|
|
|
$delMessage[] = $dataInfo['name'] . ',删除失败';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//删除列表字段配置数据
|
|
|
|
//删除列表字段配置数据
|
|
|
|
$userFieldList = db('admin_user_field')->where(['types' => $dataInfo['types']])->select();
|
|
|
|
$userFieldList = db('admin_user_field')->where(['types' => $dataInfo['types']])->select();
|
|
|
|
foreach ($userFieldList as $key => $val) {
|
|
|
|
foreach ($userFieldList as $key => $val) {
|
|
|
@ -1125,8 +1128,8 @@ class Field extends Model
|
|
|
|
'fieldName' => 'owner_user_structure_name'
|
|
|
|
'fieldName' => 'owner_user_structure_name'
|
|
|
|
];
|
|
|
|
];
|
|
|
|
foreach ($field_list as $k => $v) {
|
|
|
|
foreach ($field_list as $k => $v) {
|
|
|
|
if($v['field']=='invoice_type'){
|
|
|
|
if ($v['field'] == 'invoice_type') {
|
|
|
|
$field_list[$k]['setting']=$v['setting']?explode(chr(10), $v['setting']):[];
|
|
|
|
$field_list[$k]['setting'] = $v['setting'] ? explode(chr(10), $v['setting']) : [];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
# 处理字段授权
|
|
|
|
# 处理字段授权
|
|
|
|
$field_list[$k]['writeStatus'] = 1;
|
|
|
|
$field_list[$k]['writeStatus'] = 1;
|
|
|
@ -1254,7 +1257,7 @@ class Field extends Model
|
|
|
|
foreach ($field_list as $k => $v) {
|
|
|
|
foreach ($field_list as $k => $v) {
|
|
|
|
# 处理字段授权
|
|
|
|
# 处理字段授权
|
|
|
|
$field_list[$k]['writeStatus'] = 1;
|
|
|
|
$field_list[$k]['writeStatus'] = 1;
|
|
|
|
if($field_list[$k]['name'] == '客户级别' && !in_array(1,$adminTypes)) $field_list[$k]['writeStatus'] = 0;
|
|
|
|
if ($field_list[$k]['name'] == '客户级别' && !in_array(1, $adminTypes)) $field_list[$k]['writeStatus'] = 0;
|
|
|
|
if (!$userLevel && $param['module'] == 'crm' && !empty($grantData[$param['types']])) {
|
|
|
|
if (!$userLevel && $param['module'] == 'crm' && !empty($grantData[$param['types']])) {
|
|
|
|
$status = getFieldGrantStatus($v['field'], $grantData[$param['types']]);
|
|
|
|
$status = getFieldGrantStatus($v['field'], $grantData[$param['types']]);
|
|
|
|
|
|
|
|
|
|
|
@ -1271,7 +1274,7 @@ class Field extends Model
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ($param['action'] == 'read') {
|
|
|
|
if ($param['action'] == 'read') {
|
|
|
|
$field_list[$k]['maskType'] = $status['maskType'];
|
|
|
|
$field_list[$k]['maskType'] = $status['maskType'];
|
|
|
|
if($status['maskType']!=0){
|
|
|
|
if ($status['maskType'] != 0) {
|
|
|
|
$field_list[$k]['writeStatus'] = 0;
|
|
|
|
$field_list[$k]['writeStatus'] = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1469,32 +1472,32 @@ class Field extends Model
|
|
|
|
} elseif ($v['form_type'] == 'desc_text') {
|
|
|
|
} elseif ($v['form_type'] == 'desc_text') {
|
|
|
|
// 描述文字
|
|
|
|
// 描述文字
|
|
|
|
$value = !empty($dataInfo[$v['field']]) ? $dataInfo[$v['field']] : $v['default_value'];
|
|
|
|
$value = !empty($dataInfo[$v['field']]) ? $dataInfo[$v['field']] : $v['default_value'];
|
|
|
|
} elseif ($v['form_type']=='location') {
|
|
|
|
} elseif ($v['form_type'] == 'location') {
|
|
|
|
// 地址、定位、日期区间、明细表格
|
|
|
|
// 地址、定位、日期区间、明细表格
|
|
|
|
$primaryKey = getPrimaryKeyName($param['types']);
|
|
|
|
$primaryKey = getPrimaryKeyName($param['types']);
|
|
|
|
$positionJson = !empty($dataInfo[$primaryKey]) ? db($param['types'] . '_data')->where([$primaryKey => $dataInfo[$primaryKey], 'field' => $v['field']])->value($param['types'] == 'oa_examine' ? 'value' : 'content') : '';
|
|
|
|
$positionJson = !empty($dataInfo[$primaryKey]) ? db($param['types'] . '_data')->where([$primaryKey => $dataInfo[$primaryKey], 'field' => $v['field']])->value($param['types'] == 'oa_examine' ? 'value' : 'content') : '';
|
|
|
|
$positionData = !empty($positionJson) ? json_decode($positionJson, true) : '';
|
|
|
|
$positionData = !empty($positionJson) ? json_decode($positionJson, true) : '';
|
|
|
|
$value = $positionData;
|
|
|
|
$value = $positionData;
|
|
|
|
} elseif($v['form_type']=='detail_table'){
|
|
|
|
} elseif ($v['form_type'] == 'detail_table') {
|
|
|
|
// $fieldGrant = db('admin_field_mask')->where('types', 'contract')->select();
|
|
|
|
// $fieldGrant = db('admin_field_mask')->where('types', 'contract')->select();
|
|
|
|
$primaryKey = getPrimaryKeyName($param['types']);
|
|
|
|
$primaryKey = getPrimaryKeyName($param['types']);
|
|
|
|
$positionJson = !empty($dataInfo[$primaryKey]) ? db($param['types'] . '_data')->where([$primaryKey => $dataInfo[$primaryKey], 'field' => $v['field']])->value($param['types'] == 'oa_examine' ? 'value' : 'content') : '';
|
|
|
|
$positionJson = !empty($dataInfo[$primaryKey]) ? db($param['types'] . '_data')->where([$primaryKey => $dataInfo[$primaryKey], 'field' => $v['field']])->value($param['types'] == 'oa_examine' ? 'value' : 'content') : '';
|
|
|
|
$positionData = !empty($positionJson) ? json_decode($positionJson, true) : '';
|
|
|
|
$positionData = !empty($positionJson) ? json_decode($positionJson, true) : '';
|
|
|
|
foreach ($positionData as $kk => $val){
|
|
|
|
foreach ($positionData as $kk => $val) {
|
|
|
|
foreach ($val as $key => $values){
|
|
|
|
foreach ($val as $key => $values) {
|
|
|
|
if($values['form_type']=='user'){
|
|
|
|
if ($values['form_type'] == 'user') {
|
|
|
|
$positionData[$kk][$key]['value']= !empty($values['value'])?$userModel->getListByStr($values['value']) :[];
|
|
|
|
$positionData[$kk][$key]['value'] = !empty($values['value']) ? $userModel->getListByStr($values['value']) : [];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if($values['form_type']=='structure'){
|
|
|
|
if ($values['form_type'] == 'structure') {
|
|
|
|
$positionData[$kk][$key]['value']= !empty($values['value'])? $structureModel->getListByStr($values['value']) : [];
|
|
|
|
$positionData[$kk][$key]['value'] = !empty($values['value']) ? $structureModel->getListByStr($values['value']) : [];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if($values['form_type']=='datetime' && is_numeric($values['value'])){
|
|
|
|
if ($values['form_type'] == 'datetime' && is_numeric($values['value'])) {
|
|
|
|
$positionData[$kk][$key]['value']= date('Y-m-d, H:i:s',$values['value']);
|
|
|
|
$positionData[$kk][$key]['value'] = date('Y-m-d, H:i:s', $values['value']);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if($values['form_type']=='boolean_value'){
|
|
|
|
if ($values['form_type'] == 'boolean_value') {
|
|
|
|
$positionData[$kk][$key]['value']= (string)$values['value'];
|
|
|
|
$positionData[$kk][$key]['value'] = (string)$values['value'];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if($values['form_type']=='file'){
|
|
|
|
if ($values['form_type'] == 'file') {
|
|
|
|
$fileIds = stringToArray($values['value']);
|
|
|
|
$fileIds = stringToArray($values['value']);
|
|
|
|
$whereFile = [];
|
|
|
|
$whereFile = [];
|
|
|
|
$whereFile['module'] = 'other';
|
|
|
|
$whereFile['module'] = 'other';
|
|
|
@ -1514,36 +1517,36 @@ class Field extends Model
|
|
|
|
// $positionData[$kk][$key]['value'] = !empty($dataInfo[$val['fiele_id']]) ? (string)substr_replace($values['value'], '*',0,strlen($values['value'])) : null;
|
|
|
|
// $positionData[$kk][$key]['value'] = !empty($dataInfo[$val['fiele_id']]) ? (string)substr_replace($values['value'], '*',0,strlen($values['value'])) : null;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
$positionData[$kk][$key]['optionsData']=!empty($field_list[$k]['options']) ? json_decode($field_list[$k]['options'], true) : '';
|
|
|
|
$positionData[$kk][$key]['optionsData'] = !empty($field_list[$k]['options']) ? json_decode($field_list[$k]['options'], true) : '';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$value = $positionData;
|
|
|
|
$value = $positionData;
|
|
|
|
if ($v['form_type'] == 'detail_table') {
|
|
|
|
if ($v['form_type'] == 'detail_table') {
|
|
|
|
$content = db('admin_field_extend')->where(['types' => $types, 'field' => $v['field']])->value('content');
|
|
|
|
$content = db('admin_field_extend')->where(['types' => $types, 'field' => $v['field']])->value('content');
|
|
|
|
$content=json_decode($content, true);
|
|
|
|
$content = json_decode($content, true);
|
|
|
|
foreach ($content as &$vv){
|
|
|
|
foreach ($content as &$vv) {
|
|
|
|
$vv['optionsData']=!empty($field_list[$k]['options']) ? json_decode($field_list[$k]['options'], true) : '';
|
|
|
|
$vv['optionsData'] = !empty($field_list[$k]['options']) ? json_decode($field_list[$k]['options'], true) : '';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$field_list[$k]['fieldExtendList'] = $content;
|
|
|
|
$field_list[$k]['fieldExtendList'] = $content;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} elseif($v['form_type']=='position'){
|
|
|
|
} elseif ($v['form_type'] == 'position') {
|
|
|
|
// 地址
|
|
|
|
// 地址
|
|
|
|
$default_value = !empty($v['default_value']) ? json_decode($v['default_value'], true) : [];
|
|
|
|
$default_value = !empty($v['default_value']) ? json_decode($v['default_value'], true) : [];
|
|
|
|
if(!empty($dataInfo[$v['field']])){
|
|
|
|
if (!empty($dataInfo[$v['field']])) {
|
|
|
|
$position= explode(',',$dataInfo[$v['field']]);
|
|
|
|
$position = explode(',', $dataInfo[$v['field']]);
|
|
|
|
for ($i=0; $i<count($position); $i++) {
|
|
|
|
for ($i = 0; $i < count($position); $i++) {
|
|
|
|
$b[]['name'] =trim(json_encode($position[$i],JSON_UNESCAPED_UNICODE),'"');
|
|
|
|
$b[]['name'] = trim(json_encode($position[$i], JSON_UNESCAPED_UNICODE), '"');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$value =$b;
|
|
|
|
$value = $b;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} elseif($v['form_type']=='date_interval'){
|
|
|
|
} elseif ($v['form_type'] == 'date_interval') {
|
|
|
|
if (!empty($dataInfo[$v['field']])) {
|
|
|
|
if (!empty($dataInfo[$v['field']])) {
|
|
|
|
$position= explode('_',$dataInfo[$v['field']]);
|
|
|
|
$position = explode('_', $dataInfo[$v['field']]);
|
|
|
|
$value =$position;
|
|
|
|
$value = $position;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$default_value = !empty($v['default_value'])?explode(',',$v['default_value']):[];
|
|
|
|
$default_value = !empty($v['default_value']) ? explode(',', $v['default_value']) : [];
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$value = isset($dataInfo[$v['field']]) ? $dataInfo[$v['field']] : '';
|
|
|
|
$value = isset($dataInfo[$v['field']]) ? $dataInfo[$v['field']] : '';
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1816,7 +1819,7 @@ class Field extends Model
|
|
|
|
foreach ($dataList as $k => $v) {
|
|
|
|
foreach ($dataList as $k => $v) {
|
|
|
|
if (!$userLevel && !empty($grantData[$types])) {
|
|
|
|
if (!$userLevel && !empty($grantData[$types])) {
|
|
|
|
$status = getFieldGrantStatus($v['field'], $grantData[$types]);
|
|
|
|
$status = getFieldGrantStatus($v['field'], $grantData[$types]);
|
|
|
|
$dataList[(int)$k]['maskType']=$status['maskType'];
|
|
|
|
$dataList[(int)$k]['maskType'] = $status['maskType'];
|
|
|
|
# 查看权限
|
|
|
|
# 查看权限
|
|
|
|
if ($status['read'] == 0) unset($dataList[(int)$k]);
|
|
|
|
if ($status['read'] == 0) unset($dataList[(int)$k]);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1861,7 +1864,7 @@ class Field extends Model
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$fieldArr = $this
|
|
|
|
$fieldArr = $this
|
|
|
|
->where($where)
|
|
|
|
->where($where)
|
|
|
|
->field(['field', 'name', 'form_type', 'is_hidden','setting'])
|
|
|
|
->field(['field', 'name', 'form_type', 'is_hidden', 'setting'])
|
|
|
|
->order('order_id', 'asc')
|
|
|
|
->order('order_id', 'asc')
|
|
|
|
->select();
|
|
|
|
->select();
|
|
|
|
|
|
|
|
|
|
|
@ -1876,7 +1879,7 @@ class Field extends Model
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (isset($this->orther_field_list[$newTypes])) {
|
|
|
|
if (isset($this->orther_field_list[$newTypes])) {
|
|
|
|
foreach ($this->orther_field_list[$newTypes] as $val) {
|
|
|
|
foreach ($this->orther_field_list[$newTypes] as $val) {
|
|
|
|
if($val['field'] != 'product_picture'){
|
|
|
|
if ($val['field'] != 'product_picture') {
|
|
|
|
$res[] = $val;
|
|
|
|
$res[] = $val;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1918,8 +1921,8 @@ class Field extends Model
|
|
|
|
|
|
|
|
|
|
|
|
if ($types == 'jxc_product') {
|
|
|
|
if ($types == 'jxc_product') {
|
|
|
|
$res[] = [
|
|
|
|
$res[] = [
|
|
|
|
'field' => 'product_picture',
|
|
|
|
'field' => 'product_picture',
|
|
|
|
'name' => '产品图片',
|
|
|
|
'name' => '产品图片',
|
|
|
|
'form_type' => 'pic',
|
|
|
|
'form_type' => 'pic',
|
|
|
|
'is_hidden' => 0
|
|
|
|
'is_hidden' => 0
|
|
|
|
];
|
|
|
|
];
|
|
|
@ -2231,7 +2234,7 @@ class Field extends Model
|
|
|
|
if ($types == 'jxc_product') {
|
|
|
|
if ($types == 'jxc_product') {
|
|
|
|
$where['is_del'] = 0;
|
|
|
|
$where['is_del'] = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$res = $dataModel->where($where)->find();
|
|
|
|
$res = $dataModel->where($where)->find();
|
|
|
|
|
|
|
|
|
|
|
|
if ($res) {
|
|
|
|
if ($res) {
|
|
|
@ -2342,35 +2345,35 @@ class Field extends Model
|
|
|
|
$val = db('jxc_purchase')->where(['purchase_id' => $val])->value('order_number');
|
|
|
|
$val = db('jxc_purchase')->where(['purchase_id' => $val])->value('order_number');
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 'order_cause' :
|
|
|
|
case 'order_cause' :
|
|
|
|
if($dataInfo['receipt_type'] == '销售退货入库'){
|
|
|
|
if ($dataInfo['receipt_type'] == '销售退货入库') {
|
|
|
|
$val = db('jxc_salereturn')->where(['salereturn_id' => $val])->value('order_number');
|
|
|
|
$val = db('jxc_salereturn')->where(['salereturn_id' => $val])->value('order_number');
|
|
|
|
}elseif ($dataInfo['receipt_type'] == '采购入库') {
|
|
|
|
} elseif ($dataInfo['receipt_type'] == '采购入库') {
|
|
|
|
$val = db('jxc_purchase')->where(['purchase_id' => $val])->value('order_number');
|
|
|
|
$val = db('jxc_purchase')->where(['purchase_id' => $val])->value('order_number');
|
|
|
|
}elseif ($dataInfo['outbound_type'] == '销售出库') {
|
|
|
|
} elseif ($dataInfo['outbound_type'] == '销售出库') {
|
|
|
|
$val = db('jxc_sale')->where(['sale_id' => $val])->value('order_number');
|
|
|
|
$val = db('jxc_sale')->where(['sale_id' => $val])->value('order_number');
|
|
|
|
}elseif ($dataInfo['outbound_type'] == '采购退货出库') {
|
|
|
|
} elseif ($dataInfo['outbound_type'] == '采购退货出库') {
|
|
|
|
$val = db('jxc_retreat')->where(['retreat_id' => $val])->value('order_number');
|
|
|
|
$val = db('jxc_retreat')->where(['retreat_id' => $val])->value('order_number');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 'category_cause' :
|
|
|
|
case 'category_cause' :
|
|
|
|
$val = db('jxc_product_category')->where(['category_id' => $val])->value('category_name');
|
|
|
|
$val = db('jxc_product_category')->where(['category_id' => $val])->value('category_name');
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 'product_cause' :
|
|
|
|
case 'product_cause' :
|
|
|
|
$val = db('jxc_product')->where(['product_id' => $val])->value('product_name');
|
|
|
|
$val = db('jxc_product')->where(['product_id' => $val])->value('product_name');
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 'collection_object' :
|
|
|
|
case 'collection_object' :
|
|
|
|
if($dataInfo['collection_type'] == '采购退货'){
|
|
|
|
if ($dataInfo['collection_type'] == '采购退货') {
|
|
|
|
// $val = db('jxc_supplier')->where(['supplier_id' => $val])->value('supplier_name');
|
|
|
|
// $val = db('jxc_supplier')->where(['supplier_id' => $val])->value('supplier_name');
|
|
|
|
}elseif ($dataInfo['collection_type'] == '销售出库') {
|
|
|
|
} elseif ($dataInfo['collection_type'] == '销售出库') {
|
|
|
|
$val = db('jxc_sale')->where(['sale_id' => $val])->value('order_number');
|
|
|
|
$val = db('jxc_sale')->where(['sale_id' => $val])->value('order_number');
|
|
|
|
}elseif ($dataInfo['payment_type'] == '采购') {
|
|
|
|
} elseif ($dataInfo['payment_type'] == '采购') {
|
|
|
|
$val = db('crm_customer')->where(['customer_id' => $val])->value('name');
|
|
|
|
$val = db('crm_customer')->where(['customer_id' => $val])->value('name');
|
|
|
|
}elseif ($dataInfo['payment_type'] == '销售退货') {
|
|
|
|
} elseif ($dataInfo['payment_type'] == '销售退货') {
|
|
|
|
$val = db('jxc_salereturn')->where(['salereturn_id' => $val])->value('order_number');
|
|
|
|
$val = db('jxc_salereturn')->where(['salereturn_id' => $val])->value('order_number');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return $val;
|
|
|
|
return $val;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -2416,13 +2419,13 @@ class Field extends Model
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!$data) return $data;
|
|
|
|
if (!$data) return $data;
|
|
|
|
$list = db('admin_field')->where(['types' => $types, 'relevant' => ['neq', '']])->field('field,relevant')->select();
|
|
|
|
$list = db('admin_field')->where(['types' => $types, 'relevant' => ['neq', '']])->field('field,relevant')->select();
|
|
|
|
foreach ($list as &$val){
|
|
|
|
foreach ($list as &$val) {
|
|
|
|
$val=!empty($val)?$val:'';
|
|
|
|
$val = !empty($val) ? $val : '';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$newData = [];
|
|
|
|
$newData = [];
|
|
|
|
//crm_hfsomz
|
|
|
|
//crm_hfsomz
|
|
|
|
foreach ($list as $k => $v) {
|
|
|
|
foreach ($list as $k => $v) {
|
|
|
|
$customer_field=db('admin_field')->where(['types' => 'crm_customer', 'field_id' => $v['relevant']])->field('field')->find();
|
|
|
|
$customer_field = db('admin_field')->where(['types' => 'crm_customer', 'field_id' => $v['relevant']])->field('field')->find();
|
|
|
|
$newData[$customer_field['field']] = $data[$v['field']];
|
|
|
|
$newData[$customer_field['field']] = $data[$v['field']];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return $newData ?: [];
|
|
|
|
return $newData ?: [];
|
|
|
@ -2670,7 +2673,7 @@ class Field extends Model
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public function getFieldTypesArray($types, $form_type)
|
|
|
|
public function getFieldTypesArray($types, $form_type)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$fieldArr = db('admin_field')->where(['types' => $types, 'form_type' => ['in', $form_type]])->field(['field','name', 'form_type'])->select();
|
|
|
|
$fieldArr = db('admin_field')->where(['types' => $types, 'form_type' => ['in', $form_type]])->field(['field', 'name', 'form_type'])->select();
|
|
|
|
$fieldList = [];
|
|
|
|
$fieldList = [];
|
|
|
|
$userField = []; // 人员类型
|
|
|
|
$userField = []; // 人员类型
|
|
|
|
$structureField = []; // 部门类型
|
|
|
|
$structureField = []; // 部门类型
|
|
|
|