webmain/model/crmModel.php

(开头部分) 9KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<?php
class crmClassModel extends Model
{
	public function initModel()
	{
		$this->settable('customer');
	}
	
	//读取我的客户和共享给我的
	public function getmycust($uid=0, $id=0)
	{
		$limit  = (int)$this->rock->get('limit', '10');
		$page   = (int)$this->rock->get('page', '1');
		$key    = $this->rock->get('key');
		$where  = '';
		if($key){
			$key= $this->rock->jm->base64decode($key);
			$where.= " and (`name` like '%$key%' or `unitname` like '%$key%')";
		}
		if(isempt($id))$id = 0;
		if($uid==0)$uid=$this->adminid;
		$s		= $this->rock->dbinstr('shateid', $uid);
		$rows 	= $this->getrows("`status`=1 and ((`uid`='$uid') or (`id`=$id) or (".$s.")) $where",'SQL_CALC_FOUND_ROWS id as value,name,id,unitname as subname','`optdt` desc',''.(($page-1)*$limit).','.$limit.'');
		$totalCount = $this->db->found_rows();
		return array(
			'rows' 	=> $rows,
			'totalCount' => $totalCount,
			'limit' => $limit,
			'page' 	=> $page,
		);
	}
	
	//读取所有客户
	public function custdata($whe='')
	{
		$limit  = (int)$this->rock->get('limit', '10');
		$page   = (int)$this->rock->get('page', '1');
		$key    = $this->rock->get('key');
		$where  = m('admin')->getcompanywhere(3);
		if($key){
			$key= $this->rock->jm->base64decode($key);
			$where.= " and (`name` like '%$key%' or `unitname` like '%$key%')";
		}
		if($whe){
			$whe	= str_replace('{uid}', $this->adminid, $whe);
			$where .= " AND $whe";
		}
		$rows 	= $this->getrows("`status`=1 ".$where."",'SQL_CALC_FOUND_ROWS id as value,name,id,unitname as subname','`optdt` desc',''.(($page-1)*$limit).','.$limit.'');
		$totalCount = $this->db->found_rows();
		return array(
			'rows' 	=> $rows,
			'totalCount' => $totalCount,
			'limit' => $limit,
			'page' 	=> $page,
		);
	}
	
	
	//读取我的销售机会
	public function getmysale($uid, $id=0)
后面还有 238 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。