@@ -34,7 +34,7 @@ class UsuallyContactsService extends ServiceBase {
type:actionBody.type
}
letresult=awaitthis.create(contactsInfo);
returnsystem.getResultSuccess();
returnsystem.getResultSuccess({id:result.id});
}
//删除常用联系人、申请人
...
...
@@ -58,6 +58,16 @@ class UsuallyContactsService extends ServiceBase {
if(Object.keys(actionBody.contacts).length<0){
returnsystem.getResultFail(-1,'信息不能为空');
}
letparams={
channel_user_id:actionBody.channel_user_id,
uapp_id:pobj.appInfo.uapp_id,
type:actionBody.type,
contact_name:actionBody.contact_name
}
letitem=awaitthis.findOne(params);
if(item){
returnsystem.getResultFail(-1,'联系人已存在,请勿重复添加')
}
letobj={
id:actionBody.id,
uapp_id:pobj.appInfo.uapp_id,
...
...
@@ -73,7 +83,7 @@ class UsuallyContactsService extends ServiceBase {
//查询常用联系人、申请人
asyncgetContacts(pobj,actionBody){
letsql=`select id,channel_user_id,contact_name,contacts_content,type from c_usually_contacts where uapp_id = :uapp_id and channel_user_id = :channel_user_id and type = :type and deleted_at is null`;
letsql=`select id,channel_user_id,contact_name,contacts_content,type from c_usually_contacts where uapp_id = :uapp_id and channel_user_id = :channel_user_id and type = :type`;
if(!actionBody.type){
returnsystem.getResultFail(-1,'type 不能为空')
}
...
...
@@ -85,6 +95,11 @@ class UsuallyContactsService extends ServiceBase {