FootPrints.php 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <?php
  2. namespace app\event;
  3. class FootPrints
  4. {
  5. public $footInfo;
  6. public $type;
  7. public function __construct($user, $employee, $org, $obj, $type = '')
  8. {
  9. if (empty($type) && is_object($obj)) {
  10. $classNameSpace = get_class($obj);
  11. $path = explode('\\', $classNameSpace);
  12. $this->type = lcfirst(array_pop($path));
  13. } else {
  14. $this->type = $type;
  15. }
  16. $this->footInfo = $this->dealData($obj, $this->type);
  17. $this->user = $user;
  18. $this->employee = $employee;
  19. $this->org = $org;
  20. }
  21. public function dealData($obj, $type)
  22. {
  23. if(!$obj) return [];
  24. $data = is_array($obj) ? $obj : $obj->toArray();
  25. $typeColumn = [
  26. 'wwbm' => ['name', 'remark', 'phone'], //微网报名
  27. 'activity' => ['id', 'title'], //活动
  28. 'materialCase' => ['id', 'title'], //案例
  29. 'materialEvidence' => ['id', 'title'], //口碑见证
  30. 'priceCalculation' => ['value', 'name', 'mobile', 'community', 'area', 'bedroom', 'style', 'type'], //装修报价
  31. 'styleTest' => ['value', 'style', 'id'], //风格测一测
  32. 'likeTest' => ['value', 'style', 'id'], //喜好测一测
  33. 'toolDecohelper' => ['id', 'title'], //装修知识
  34. 'video' => ['id', 'title'], //视频
  35. 'share' => ['name','mobile', 'data', 'remark'], //链接分享报名
  36. 'article' => ['id', 'title'], //图文素材
  37. 'building' => ['id', 'name','prompt'], //楼盘进度
  38. 'construction' => ['id', 'name'], //在施工地
  39. 'designer' => ['id', 'title', 'share_pipe_type', 'share_data_id','mobile'], //预约设计师
  40. 'card' => [], //名片
  41. 'quote' => ['area', 'room', 'hall', 'bathroom', 'phone'], //装修报价
  42. 'building_urge'=> ['id', 'name','phone'], //热装楼盘催更新
  43. 'CompanyStrength'=> ['id', 'title'], //公司实力
  44. 'companyStrength'=> ['id', 'title'], //公司实力
  45. 'askedfitup' => ['phone'],//热装楼盘询问装修
  46. 'lottery' => ['actid','type','title','luckname'],//大转盘砸金蛋
  47. 'materialCaseVr' => ['id','title'],//案例详情vr
  48. 'buildingVr' => ['id','name'],//热装楼盘详情vr
  49. 'constructionVr' => ['id','name'],//在施工地详情vr
  50. 'companyVr' => ['id','vr_show','name'],//原来VR展厅
  51. 'employeeCardVr' => [], //vr名片
  52. 'getDecorationDesign' => ['community', 'area', 'bedroom', 'mobile'], // 获取设计方案
  53. 'toolAll' => ['uid','name','type'], //谈单工具
  54. 'agents' => ['agent_name', 'agent_phone'], //经纪人分享
  55. 'spellgroup' => [], //装修拼团
  56. 'devcase' => ['id','name'],
  57. 'progressDetail' => ['id','name'],//楼盘进度详情
  58. 'activitySignUp' => ['phone','aid','uid'],//活动报名
  59. 'agentArticle' => ['id', 'title'], //经纪人分享文章
  60. 'agentShareContentCrm' => ['name', 'phone', 'community_name'], //经纪人分享的内容客户进行报名
  61. 'TrainClassList' => ['id'], //课程列表
  62. 'TrainClass' => ['id','title'], //课程详情
  63. 'TrainCourse' => ['id','title','class_title','class_id'], //课件详情
  64. 'housetype' => ['id','room','hall','bathroom'],//户型足迹
  65. 'buildingHousetype' => ['id','room','hall','bathroom'],//户型足迹
  66. 'groupVr' => ['id','title','prompt','phone'],//户型足迹
  67. 'groupVrVr' => ['id','title','prompt','phone'],//户型足迹
  68. 'housetypeVr' => ['id','room','hall','bathroom','prompt'],//户型足迹
  69. ];
  70. if (!isset($typeColumn[$type])) return [];
  71. $jData = [];
  72. foreach ($typeColumn[$type] as $c) {
  73. if (isset($data[$c]))
  74. $jData[$c] = $data[$c];
  75. }
  76. return $jData;
  77. }
  78. }