Cusrecord.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. namespace app\admin\controller\qingdong\customer;
  3. use app\admin\controller\qingdong\Base;
  4. use think\Db;
  5. use think\Exception;
  6. /**
  7. * 合同跟进记录管理
  8. * 操作文档:https://doc.fastadmin.net/qingdong
  9. * 软件介绍:https://www.fastadmin.net/store/qingdong.html
  10. * 售后微信:qingdong_crm
  11. */
  12. class Cusrecord extends Base {
  13. protected $relationSearch = true;
  14. /**
  15. * @var \addons\qingdong\model\Contract
  16. */
  17. protected $model = null;
  18. public function _initialize() {
  19. parent::_initialize();
  20. $this->model = new \addons\qingdong\model\Record();
  21. }
  22. /**
  23. * 查看
  24. */
  25. public function index() {
  26. //设置过滤方法
  27. if ($this->request->isAjax()) {
  28. $params = $this->request->get();
  29. list($where, $sort, $order, $offset, $limit) = $this->buildparams();
  30. $wheres = [];
  31. $wheres['relation_id'] = $params['ids'];
  32. $list = $this->model->with(['file'])->where($where)->where($wheres)
  33. ->order($sort, $order)->paginate($limit);
  34. $data = $list->items();
  35. //// foreach($data as &$v){
  36. //// $contract_remark='';
  37. //// $contract_other = $v['contract_other'];
  38. //// $otherdata = json_decode($contract_other['otherdata'],true);
  39. //// if(is_array($otherdata)){
  40. //// if(isset($otherdata['other_upnhey'])){
  41. //// $contract_remark = $otherdata['other_upnhey'];
  42. //// }
  43. //// if(isset($otherdata['other_zdywys'])){
  44. //// $contract_remark = $otherdata['other_zdywys'];
  45. //// }
  46. //// }
  47. //// $v['contract_remark'] = $contract_remark;
  48. ////// outFileLog($contract_remark,'cus_contract','$v');
  49. // }
  50. $result = array("total" => $list->total(), "rows" => $list->items());
  51. return json($result);
  52. }
  53. return $this->view->fetch();
  54. }
  55. }