| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- <?php
- namespace app\admin\controller\qingdong\customer;
- use app\admin\controller\qingdong\Base;
- use think\Db;
- use think\Exception;
- /**
- * 合同管理
- * 操作文档:https://doc.fastadmin.net/qingdong
- * 软件介绍:https://www.fastadmin.net/store/qingdong.html
- * 售后微信:qingdong_crm
- */
- class Cuscontract extends Base {
- protected $relationSearch = true;
- /**
- * @var \addons\qingdong\model\Contract
- */
- protected $model = null;
- public function _initialize() {
- parent::_initialize();
- $this->model = new \addons\qingdong\model\Contract;
- }
- /**
- * 查看
- */
- public function index() {
- //设置过滤方法
- if ($this->request->isAjax()) {
- $params = $this->request->get();
- list($where, $sort, $order, $offset, $limit) = $this->buildparams();
- $wheres = [];
- $wheres['customer_id'] = $params['ids'];
- $list = $this->model->where($where)->where($wheres)
- ->with([
- 'customer',
- 'orderStaff',
- 'contacts',
- 'contractOther'
- ])->order($sort, $order)->paginate($limit);
- $data = $list->items();
- foreach($data as &$v){
- $contract_remark='';
- $contract_other = $v['contract_other'];
- $otherdata = json_decode($contract_other['otherdata'],true);
- if(is_array($otherdata)){
- if(isset($otherdata['other_zdywys'])){
- $contract_remark = $otherdata['other_zdywys'];
- }
- }
- $v['contract_remark'] = $contract_remark;
- // outFileLog($contract_remark,'cus_contract','$v');
- }
- $result = array("total" => $list->total(), "rows" => $list->items());
- return json($result);
- }
- return $this->view->fetch();
- }
- }
|