mode_customerAction.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php
  2. //客户录入
  3. class mode_customerClassAction extends inputAction{
  4. protected function savebefore($table, $arr, $id, $addbo){
  5. }
  6. protected function saveafter($table, $arr, $id, $addbo){
  7. $name = $arr['name'];
  8. m('custfina')->update("`custname`='$name'", "`custid`='$id'");
  9. m('custract')->update("`custname`='$name'", "`custid`='$id'");
  10. m('custsale')->update("`custname`='$name'", "`custid`='$id'");
  11. m('custappy')->update("`custname`='$name'", "`custid`='$id'");
  12. m('goodm')->update("`custname`='$name'", "`custid`='$id' and `type` in(1,2)");//1采购,2销售
  13. m('crm')->custtotal($id);
  14. }
  15. public function getothernrAjax()
  16. {
  17. $custid = (int)$this->get('custid','0');//客户id
  18. $ind = (int)$this->get('ind','0');//第几个选择卡
  19. $bh = 'custsale';//销售机会的
  20. $atype = 'all'; //流程模块条件编号
  21. if($ind==2)$bh='custract';
  22. if($ind==3){
  23. $bh='custfina';
  24. $atype = 'allskd'; //所有收款单的
  25. }
  26. if($ind==4){
  27. $bh='custfina';
  28. $atype = 'allfkd';//所有付款单!
  29. }
  30. if($ind==5){
  31. $bh='custxiao';
  32. }
  33. if($ind==6){
  34. $bh='custplan';
  35. }
  36. //读取数据
  37. $flow = m('flow')->initflow($bh);//初始化模块
  38. //调用方法getrowstable是在webmain\model\flow\flow.php 里面的,
  39. //第一个参数,流程模块条件的编号,如果没有这个编号是读取不到数据
  40. //第二个参数,额外添加的条件,下面那说明的跟这个客户有关
  41. //第3个参数,默认读取的条数,默认是100
  42. $cont = $flow->getrowstable($atype, 'and `custid`='.$custid.'');//读取表格数据
  43. return $cont;
  44. }
  45. public function shatetoAjax()
  46. {
  47. $sna = $this->post('sna');
  48. $sid = c('check')->onlynumber($this->post('sid'));
  49. $khid = c('check')->onlynumber($this->post('khid'));
  50. m('customer')->update(array(
  51. 'shate' => $sna,
  52. 'shateid' => $sid,
  53. ),"`id` in($khid)");
  54. }
  55. }
粤ICP备19079148号