您的位置:首页 > 其它

续“SunshineCRM系统”二次开发总结

2016-06-06 09:13 465 查看
前边讲了一些基础的操作,如何从本地服务器迁移至万网等FTP空间中遇到的若干问题,下边是链接,可以关注下;

最近对一些基本客户模块做了一些修改

1、客户视图模式,创建人和归属人错误,创建人一直和归属人显示一样,这个是系统本身的问题,已修正;

将文件你的服务器根目录(一般是www下)\general\ERP\Interface\JXC\customer_newai.php  找到if($_GET['action']=="view_default") {然后将sql语句替换为
$sql = "SELECT a.*,b.`name` as state,c.`name` as enterstype,a.style,z.USER_NAME as chuangjianren,e.USER_NAME,f.`name` as origin,g.`name` as salemode,h.`name` as property,a.yuchuzhi,a.createdate,a.integral,a.explainStr FROM customer a
LEFT JOIN customerlever b on a.state=b.ROWID LEFT JOIN unitprop c on a.enterstype=c.ROWID LEFT JOIN `user` ee on a.user_id=ee.USER_ID LEFT JOIN `user` z on a.user_id=z.user_id left join `user` e on a.sysuser=e.USER_ID LEFT JOIN customerorigin f on a.origin=f.ROWID LEFT JOIN salemode g on a.salemode=g.ROWID LEFT JOIN property h on a.property=h.ROWID WHERE a.ROWID=".$billid;

找到
<td class="TableContent" nowrap="">创建者:</td>
后边替换为
<td class="TableData" nowrap="" colspan="1"><a target='_blank' href='../Framework/user_newai.php?<?php echo base64_encode("action=view_default&UID=$UID")?>'><?php echo $rs_a[0][chuangjianren] ?></a></td>

2、如何在客户视图中移交该客户至另外一个用户?原系统没有这个功能,只需简单修改即可,效果如图;



还是\general\ERP\Interface\JXC\customer_newai.php 这个文件  68行将打印的input替换为

<input type="button" accesskey="p" name="print"
value=" 移交 " class="SmallButtonA"
onclick="window.open('../CRM/inc_crm_tools.php?<?php echo base64_encode("action=add_yijiao&custlist=$billid")?>');">

3、如何将跟踪记录直接显示在客户视图中,如图效果;



还是\general\ERP\Interface\JXC\customer_newai.php 这个文件,找到//跟踪记录  这整个模块,将其整体替换(注意:因为我调用了不同的字段,复制的时候需要修改成自己需要的信息)

//跟踪记录

$sql = "SELECT a.chance,a.linkmanid,a.id,a.contacttime,a.user_id,a.describes,a.nextcontacttime,a.nextissue,b.`阶段`,c.`名称`,d.linkmanname FROM crm_contact a LEFT JOIN crm_jieduan b on a.stage=b.`编号` left join crm_dict_servicesources c on a.contact=c.`编号` left join linkman d on a.linkmanid=d.ROWID WHERE a.customerid=".$billid." ORDER BY a.contacttime DESC";
$rs = $db->Execute($sql);
$rs_a = $rs->GetArray();

print("<tr class='TableData1'><td colspan='32' nowrap='' width='100%'>
<table class='TableBlock' align='center' width='99.6%'>
<tr class='TableContent'>
<td colspan='9' nowrap='' width='100%'><b style='display:block;float:left;'>跟踪记录</b>
<input style='float:right;' type='button' accesskey='n' value=' 新建 ' class='SmallButtonA' onclick=\"window.open('crm_contact_newai.php?action=add_default&customerid=".$_GET['ROWID']."');\" title='快捷键:ALT+n'>
</td>
</tr>");
print("<tr class='TableContent'>
<td nowrap=''>我方联系人</td>
<td nowrap=''>南北地区</td>
<td nowrap=''>联系内容</td>
<td nowrap=''>联系时间</td>
<td nowrap=''>下次联系时间</td>
<td nowrap=''>是否联系</td>
<td nowrap=''>是否成交</td>
<td nowrap=''>编辑</td>
<td nowrap=''>删除</td>
</tr>");
if(empty($rs_a)){
print("<tr class='TableData1' height='100%'><td colspan='9' nowrap=''>暂无</td></tr>");
print("<tr class='TableData1' height='100%'><td colspan='9' nowrap=''> </td></tr>");
print("<tr class='TableData1' height='100%'><td colspan='9' nowrap=''> </td></tr>");
print("<tr class='TableData1' height='100%'><td colspan='9' nowrap=''> </td></tr>");
print("<tr class='TableData1' height='100%'><td colspan='9' nowrap=''> </td></tr>");
print("<tr class='TableData1' height='100%'><td colspan='9' nowrap=''> </td></tr>");
print("<tr class='TableData1' height='100%'><td colspan='9' nowrap=''> </td></tr>");
print("<tr class='TableData1' height='100%'><td colspan='9' nowrap=''> </td></tr>");
print("<tr class='TableData1' height='100%'><td colspan='9' nowrap=''> </td></tr>");
}else{
$sqla = "SELECT count(distinct id) FROM crm_contact WHERE customerid=".$billid."";
$rsa = $db->Execute($sqla);
$rs_aa = $rsa->GetArray();
$ida = $rs_aa[0]['count(distinct id)'];
for($i=0;$i<$ida;$i++){
if(!isset($rs_a[$i])){
print("<tr class='TableData1' height='100%'><td colspan='9' nowrap=''> </td></tr>");
continue;
}
$zhuti=returntablefield("crm_chance", "编号", $rs_a[$i]['chance'], '机会主题,客户需求');

print("<tr class='TableData1'>
<td nowrap='' style='border-bottom: 1px #CFDDEA solid;border-right: 1px #CFDDEA solid;'>".str_replace(array('admin','snn','liuyongling','mafeng','xiexiaoping','xuqiaoling','huangzhenjack','hzl','ssjfpx001'),array('系统管理员','用户1','用户2','用户3','用户4','用户5','用户6','用户7'),$rs_a[$i]['user_id'])."</td><!--找到user表,将你的id和用户名称放到这,我没有找到调用数据库的方法,有好的方式告诉我一下,能力有限啊~-->
<td nowrap='' style='border-bottom: 1px #CFDDEA solid;border-right: 1px #CFDDEA solid;'>".$rs_a[$i]['名称']."</td>
<td nowrap='' width='500px;' style='border-bottom: 1px #CFDDEA solid;border-right: 1px #CFDDEA solid;'>".$rs_a[$i]['describes']."</td>
<td nowrap='' style='border-bottom: 1px #CFDDEA solid;border-right: 1px #CFDDEA solid;'>".$rs_a[$i]['contacttime']."</td>
<td nowrap='' style='border-bottom: 1px #CFDDEA solid;border-right: 1px #CFDDEA solid;'>".$rs_a[$i]['nextcontacttime']."</td>
<td nowrap='' width='200px;' style='border-bottom: 1px #CFDDEA solid;border-right: 1px #CFDDEA solid;'>".str_replace(array('1','2'),array('是','否'),$rs_a[$i]['nextissue'])."</td><!--这点我也做了修改,将下次联系内容修改为了是和否,方便查找数据库-->
<td nowrap='' style='border-bottom: 1px #CFDDEA solid;border-right: 1px #CFDDEA solid;'>".str_replace(array('1','11','12'),array('需要跟踪联系','不是目标客户','成交客户'),$rs_a[$i]['阶段'])."</td>
<td nowrap='' style='border-bottom: 1px #CFDDEA solid;border-right: 1px #CFDDEA solid;'>
<a target='_blank' href='crm_contact_newai.php?".base64_encode("action=edit_default&id=".$rs_a[$i]['id'])."' title='".cutStr($rs_a[$i]['describes'],50)."'>编辑</a></td>
<td nowrap='' style='border-bottom: 1px #CFDDEA solid;border-right: 1px #CFDDEA solid;'>
<a target='_blank' href='crm_contact_newai.php?".base64_encode("action=delete_array&selectid=".$rs_a[$i]['id'])."' title='".cutStr($rs_a[$i]['describes'],50)."'>删除</a></td><!--这个加上去貌似有点小危险,不小心就直接删除了,弹出确认我做不来啊~-->
</tr>");
}
}
print("</table>");
print("</td></tr></td/</tr>");

我想建一个群,关于该系统开发的群,我微信,cuiguorui108,一起交流 

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  单点CRM系统