$contect .= "<td nowrap style='cursor:hand' onclick=loadmemberbuy('resort','lasthf',document.getElementById('nowpage').value,document.getElementById('pagecount').value)>最后回访日期<span id=lasthf>{$lasthf}</span></td>"; $contect .= "<td nowrap >最近回访摘要</td>"; $contect .= "<td nowrap>操作区</td>"; $contect .= "</tr>"; if (!empty($atcompany)) { $atcompany = iconv('utf-8', 'gbk', unescape($atcompany)); $querywhere .= " and fd_webcus_name like '%{$atcompany}%'"; } if (!empty($atcity)) { $atcity = iconv('utf-8', 'gbk', unescape($atcity)); $querywhere .= " and (fd_provinces_name like '%{$atcity}%' or fd_city_name like '%{$atcity}%')"; } $beginpage = ($page - 1) * $pagecount; //会员资料 $query = "select fd_webcus_id,fd_webcus_allname,\n fd_city_name , fd_webcus_newtime as joindate ,fd_provinces_name ,\n fd_webcus_lasthfdate as lasthf,fd_webcus_lasthfcontect\n\tfrom tb_webcustomer \n\tleft join tb_city on fd_city_code = fd_webcus_city\n\tleft join tb_provinces on fd_provinces_code = fd_webcus_provinces\n\twhere fd_webcus_erpcusid <> 0 {$querywhere} order by {$sort} {$sorttype} limit {$beginpage},{$pagecount}\n\t"; $db->query($query); if ($db->nf()) { $v = 0; while ($db->next_record()) { $cusid = $db->f(fd_webcus_id); if ($v == 0) { $vv = "where fd_webcus_id = '{$cusid}'"; } else { $vv .= " or fd_webcus_id = '{$cusid}'"; } $arr_memname[$cusid] = $db->f(fd_webcus_allname); $arr_linkman[$cusid] = @implode("<br>", $arr_linkman_t[$cusid]); $arr_phone[$cusid] = @implode("<br>", $arr_linkphone_t[$cusid]); $arr_city[$cusid] = $db->f(fd_provinces_name) . $db->f(fd_city_name); $arr_joindate[$cusid] = $db->f(joindate); $arr_lasthf[$cusid] = $db->f(lasthf);
<?php require "../include/common.inc.php"; $db = new DB_test(); $db1 = new DB_test(); $db2 = new DB_test(); $dberp = new DB_erptest(); $query = "select * from web_order where fd_order_seltdate='2012-12-04' and fd_order_zf=0"; $db->query($query); if ($db->nf()) { while ($db->next_record()) { $orderid = $db->f(fd_order_id); $arr_web[$orderid] = $db->f(fd_order_allcost); $sumweb += number_format($db->f(fd_order_allcost), 2, ".", ""); } } $query = "select * from tb_salelist where fd_selt_date='2012-12-04' and fd_selt_organid = 1 "; $dberp->query($query); if ($dberp->nf()) { while ($dberp->next_record()) { $orderid = $dberp->f(fd_selt_weborderid); $arr_erp[$orderid] = number_format($dberp->f(fd_selt_allcost), 2, ".", ""); $sumerp += number_format($dberp->f(fd_selt_allcost), 2, ".", ""); } } echo $sumweb . "##" . $sumerp . "<br>"; while (list($orderid, $val) = @each($arr_web)) { if ($arr_web[$orderid] != $arr_erp[$orderid]) { echo $orderid . "&&" . $arr_web[$orderid] . "!=" . $arr_erp[$orderid] . "<br>"; } }