mode_customerAction.php 1.9 KB

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