fixed
This commit is contained in:
@@ -121,23 +121,32 @@ class Firm extends Backend
|
||||
public function importBasic($ids = null)
|
||||
{
|
||||
$firmstoreData = Db::table('fa_firmstore')->where('firm_id',$ids)->select();
|
||||
if (count($firmstoreData) == 0){
|
||||
if (empty($firmstoreData)){
|
||||
return json(['code'=>201,'msg'=>'请先添加门店']);
|
||||
}
|
||||
//大类
|
||||
$firmbigcategoryData = Db::table('fa_firmbigcategory')->where('firm_id',1)->select();
|
||||
if (empty($firmbigcategoryData)){
|
||||
return json(['code'=>201,'msg'=>'请先添加大类模版']);
|
||||
}
|
||||
foreach ($firmbigcategoryData as $key=>&$val){
|
||||
unset($val['id']);
|
||||
$val['firm_id'] = $ids;
|
||||
}
|
||||
//客户来源
|
||||
$firmcustomeroriginData = Db::table('fa_firmcustomerorigin')->where('firm_id',1)->select();
|
||||
if (empty($firmcustomeroriginData)){
|
||||
return json(['code'=>201,'msg'=>'请先添加客户来源模版']);
|
||||
}
|
||||
foreach ($firmcustomeroriginData as $key=>&$val){
|
||||
unset($val['id']);
|
||||
$val['firm_id'] = $ids;
|
||||
}
|
||||
//职务
|
||||
$firmdutyData = Db::table('fa_firmduty')->where('firm_id',1)->where('firmstore_id',1)->select();
|
||||
if (empty($firmdutyData)){
|
||||
return json(['code'=>201,'msg'=>'请先添加职务模版']);
|
||||
}
|
||||
$firmdutyMore = [];
|
||||
foreach ($firmdutyData as $key=>&$val){
|
||||
$data = [];
|
||||
@@ -150,6 +159,9 @@ class Firm extends Backend
|
||||
}
|
||||
//标签
|
||||
$firmtagsData = Db::table('fa_firmtags')->where('firm_id',1)->select();
|
||||
if (empty($firmtagsData)){
|
||||
return json(['code'=>201,'msg'=>'请先添加职务模版']);
|
||||
}
|
||||
foreach ($firmtagsData as $key=>&$val){
|
||||
unset($val['id']);
|
||||
$val['firm_id'] = $ids;
|
||||
|
||||
Reference in New Issue
Block a user