Commit f84c25e8 authored by clone's avatar clone

Merge branch '0225-v3.1.0' into test

# Conflicts: # application/index/extend/Basic.php # application/model/AAgents.php
parents 6e23d4db 9e470043
......@@ -11,6 +11,7 @@ use app\model\GHouses;
use app\model\GHousesImgs;
use app\model\GHousesToAgents;
use app\model\GImageDepot;
use app\model\OPayLogModel;
use app\model\OPushMessageModel;
use app\model\OReportModel;
use app\model\Users;
......@@ -254,13 +255,43 @@ class AppointmentTime extends Basic
$result[$key]["images"] = count($res) > 0 ? $res : [];
}
}
//todo 是否评价
$evaluateResult = $this->evaluateMode->getIsEvaluate(10, $val["id"], $params["user_id"]);
$result[$key]["is_evaluate"] = count($evaluateResult) > 0 ? 1 : 0;
$result[$key]["is_evaluate"] = $this->isEvaluate($val["id"],$params["user_id"]);
}
return $result;
}
/**
* 评价,追评 标签显示
* 0 显示评价经纪人 1 显示追评 2 显示已评价 7151
* @param $report_id
* @param $user_id
* @return int
*/
public function isEvaluate($report_id,$user_id){
//是否评价
$evaluateResult = $this->evaluateMode->getIsEvaluate(10, $report_id, $user_id);
$evaluate_count = count($evaluateResult);
//收款
$is_pay = 0;
$field_pay_log = "id,report_id";
$m_paylog = new OPayLogModel();
$payLogData = $m_paylog->selectPayLogByOrderNo($field_pay_log, ["report_id" => $report_id]);
if (count($payLogData) > 0) {
$is_pay = 1;
}
if ($evaluate_count == 0) {
$is_evaluate = 0;
} elseif (($evaluate_count == 1)&&($is_pay == 1)) {
$is_evaluate = 1;
} else {
$is_evaluate = 2;
}
return $is_evaluate;
}
/**
* @param $pageNo
* @param $pageSize
......
......@@ -111,6 +111,93 @@ class Broker extends Basic
return $this->response($data['status'], $data['msg'], $data['data']);
}
/**
* 咨询经纪人
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function indexV2()
{
header('Access-Control-Allow-Origin:*');
if (empty($this->params['house_id'])) {
$this->response(101, '参数错误');
}
$list = [];
$agents = new AAgents();
$m_march = new OMarchInModel();
$m_evaluate = new Evaluate();
//查找30天带看最多的人
$report_fields = 'a.reception_id';
$report_where['b.house_id'] = $this->params['house_id'];
$report_where['a.create_time'] = ['between', [date('Y-m-d', strtotime("-30 day")) . ' 00:00:00', date('Y-m-d').' 23:59:59']];
$reception_id = $m_march->getMaxMarchInAgent($report_fields, $report_where);
$fields_agent = 'id,name,img,phone';
if (!empty($reception_id['reception_id'])) {
$march_agent = $agents->findByOne($fields_agent, [ 'id' => $reception_id['reception_id']]);
if (!empty($march_agent)){
$march_agent['show_content'] = '我对本铺非常了解,最近带看本铺多次';
array_push($list, $march_agent);
}
}
$fields = 'a.id,a.name,a.img,a.phone';
//客方
if (!empty($this->userId)) {
if (!empty($list[0]['id'])) {
$client_where['b.agent_id'] = ['neq', $list[0]['id']];
}
$client_where['b.id'] = $this->userId;
$client = $agents->getAgentUser($fields, $client_where); //客方
if (!empty($client)){
$client['show_content'] = '帮助客户找更多,善于了解客户需求';
array_push($list, $client);
}
}
//独家方
if (!empty($list[0]['id']) && !empty($list[1]['id'])) {
$where['a.id'] = ['not in', [$list[0]['id'], $list[1]['id']]];
} elseif (!empty($list[0]['id'])) {
$where['a.id'] = ['neq', $list[0]['id']];
} elseif (!empty($list[1]['id'])) {
$where['a.id'] = ['neq', $list[1]['id']];
}
$where['b.houses_id'] = $this->params['house_id'];
$where['b.is_del'] = $where['a.status'] = 0;
$where['b.type'] = 3;
$house_agent = $agents->getAgentHouseType($fields, $where);
if (!empty($house_agent)){
$house_agent['show_content'] = '本铺由我登记,熟悉房源信息';
array_push($list, $house_agent);
}
foreach ($list as $k => $v) {
$list[$k]['head_portrait'] = $v['img'];
$evaluate_data = $m_evaluate->getAgentEvaluateFraction('count(id) as evaluate,sum(evaluate_grade) as evaluate_grade', ['agents_id'=>$v['id']]);
if ($evaluate_data[0]['evaluate_grade']) {
$evaluate_grade = floor(($evaluate_data[0]['evaluate_grade'] / 2) / $evaluate_data[0]['evaluate']);
} else {
$evaluate_grade = 0;
}
$list[$k]['evaluate_grade'] = $evaluate_grade;
$list[$k]['evaluate'] = $evaluate_data[0]['evaluate'];
unset($list[$k]['img']);
}
$data['list'] = $list;
$data['url'] = AGENTHEADERIMGURL;
return $this->response(200, '', $data);
}
/**
* 评价经纪人
*
......@@ -139,6 +226,12 @@ class Broker extends Basic
return $this->response($data['status'], 'source is null');
}
if (is_numeric($params['type'])) {
$type = $params['type'];
}else{
$type = 0;
}
$date = date('Y-m-d H:i:s');
$id_arr = [];
if (isset($params['sign_name'])) {
......@@ -170,6 +263,7 @@ class Broker extends Basic
'create_time' => $date,
'update_time' => $date,
'is_show' => 0,
'type' => $type,
'house_id' => $params['house_id']
]);
......
......@@ -324,7 +324,7 @@ class Shop extends Basic
return $this->response("101", "请求来源错误");
}
$field = "a.id,a.external_title as title,a.external_address as address,a.city,a.disc,a.business_district_id,a.status,a.external_image_id,
$field = "a.id,a.internal_title,a.external_title as title,a.external_address as address,a.city,a.disc,a.business_district_id,a.status,a.external_image_id,
a.industry_type,a.shop_area_start,a.shop_area_end,a.shop_type,a.residue_num,a.shop_sign,a.is_carefully_chosen,a.rent_type,
a.rent_price,a.management_fee,a.slotting_fee,a.total,a.market_area,a.is_has_gas,a.file_path,a.longitude,a.latitude,
b.enter_num,b.external_item_advantage as item_advantage,b.sign_rule,b.do_business_date, b.opening_date,b.traffic,
......@@ -404,6 +404,9 @@ class Shop extends Basic
$result['new_sign_rule'] = "付{$result['payment_month']}{$result['deposit_month']},签订{$result['age_limit']}年";
$result['payment_deposit'] = empty($result['payment_month']) ? "" : "付{$result['payment_month']}{$result['deposit_month']}";
$result['age_limit'] = empty($result['age_limit']) ? "" : "签订{$result['age_limit']}年";
$result['address'] = $result['city'].$result['disc'].$result['internal_title'];//7151
return $this->response("200", 'request success', $result);
}
......
<?php
namespace app\api\extend;
/**
* Created by PhpStorm.
* User: zw
* Date: 2017/12/4
* Time: 9:35
* 基类
*/
use app\extra\RedisExt;
use app\model\Users;
use think\Controller;
use think\Exception;
use Think\Log;
use think\Request;
use think\Response;
use Qiniu;
use UnexpectedValueException;
use InvalidArgumentException;
class Basic extends Controller
{
/**
* 访问请求对象
* @var Request
*/
public $request;
public $params;
public $user_city;
protected $authToken;
/**
* @var int userId
*/
protected $userId;
protected $userNick;
protected $phone;
protected $timeStamp_;
protected $filterVerify = array(
"api/getShopList",
"api/sendSms",
"api/sendCode",
"api/userVerify",
"api/saveWxInfo",
"api/logout",
"api/login",
"api/register",
"api/shopList",
"api/filtrateCondition",
"api/filtrateConditionV2",
"api/getShopDetail",
"api/bannerList",
"api/averagePriceAndTurnover",
"api/getBroker",
"api/brokerDetail",
"api/commentAndDeal",
"api/check_code",
"api/convertOrderByTime",
"api/convertMarchIn",
"api/convertCollectingBill",
"api/getVersionNo",
"api/getVersionNoV2",
"api/getMarchInList",
"api/addSublet",
"api/getSiteListApp",
"api/recordCallNumShare",
"api/addUserCallAgentV2"
);
/**
* 基础接口SDK
* @param Request|null $request
*/
public function __construct(Request $request = null)
{
// CORS 跨域 Options 检测响应
$this->corsOptionsHandler();
// 输入对象
$this->request = is_null($request) ? Request::instance() : $request;
if (strtoupper($this->request->method()) === "GET") {
$this->params = $this->request->param();
} elseif (strtoupper($this->request->method()) === "POST") {
$this->params = $this->request->param() != null ? $this->request->param() : null;
}
if (isset($this->params['AuthToken']) && $this->params['AuthToken'] != 'null' && !empty($this->params['AuthToken'])) {
$jwt = new \Firebase\JWT\JWT();
try {
$result = $jwt->decode($this->params['AuthToken'], config('jwt_key'), array( 'HS256' )); //解码token
} catch( UnexpectedValueException $e) {
echo json_encode(array( "code" => "300", "msg" => "AuthToken parameter error!", "data" => [], "type" => "json" ));
exit;
} catch( InvalidArgumentException $e) {
echo json_encode(array( "code" => "300", "msg" => "AuthToken parameter error!", "data" => [], "type" => "json" ));
exit;
}
$this->authToken = $this->params['AuthToken'];
$this->userId = $result->data->id;
$this->phone = $result->data->phone;
$this->userNick = isset($result->data->userNick) ? $result->data->userNick : "";
$this->timeStamp_ = $result->timeStamp_;
}
$this->getCity($this->userId);
$requestPath = $this->request->routeInfo()["rule"][0] . "/" . $this->request->routeInfo()["rule"][1];
//过滤掉不需要验证token的接口
if (!in_array(trim($requestPath), $this->filterVerify)) {
$this->tokenVerify();
}
}
/**
* 默认城市选择
* @param $userId
*/
public function getCity($userId)
{
if(!$userId){
return;
}
try {
$redis_ = RedisExt::getRedis();
if ($redis_) {
$city = $redis_->get("user_city_" . $userId);
$this->user_city = empty($city) ? "上海市" : $city;
} else {
$this->user_city = "上海市";
}
Log::record("-------basic-------".$redis_->get("user_city_" . $userId),"info");
} catch (Exception $exception) {
$this->user_city = "上海市";
}
}
/**
* token 验证
*/
public function tokenVerify()
{
if (!isset($this->params['AuthToken'])) {
echo json_encode(array( "code" => "300", "msg" => "AuthToken不能为空!", "data" => [], "type" => "json" ));
exit;
}
$this->verifyUserInfo();
$this->verifyTime();
}
public function verifyTime()
{
//authToken有效期为30天
if ((time() - $this->timeStamp_) > 2592000) {
echo json_encode(array( "code" => "300", "msg" => "AuthToken失效,请重新登录!", "data" => [], "type" => "json" ));
exit;
}
}
public function verifyUserInfo()
{
$userModel = new Users();
$userArr = $userModel->selectUser($this->userId);
if (count($userArr) > 0 && ($userArr["id"] != $this->userId || $userArr["user_phone"] != $this->phone)) {
echo json_encode(array( "code" => "300", "msg" => "用户验证失败,重新登录!", "data" => [], "type" => "json" ));
exit;
}
return true;
}
/**
* 输出返回数据
* @param string $msg 提示消息内容
* @param string $code 业务状态码
* @param mixed $data 要返回的数据
* @param string $type 返回类型 JSON XML
* @return Response
*/
public function response($code = 'SUCCESS', $msg, $data = [], $type = 'json')
{
$result = [ 'code' => $code, 'msg' => $msg, 'data' => $data, 'type' => strtolower($type) ];
return Response::create($result, $type);
}
/**
* 一维数据数组生成数据树
* @param array $list 数据列表
* @param string $id 父ID Key
* @param string $pid ID Key
* @param string $son 定义子数据Key
* @return array
*/
public static function arr2tree($list, $id = 'id', $pid = 'pid', $son = 'sub')
{
list($tree, $map) = [ [], [] ];
foreach ($list as $item) {
$map[$item[$id]] = $item;
}
foreach ($list as $item) {
if (isset($item[$pid]) && isset($map[$item[$pid]])) {
$map[$item[$pid]][$son][] = &$map[$item[$id]];
} else {
$tree[] = &$map[$item[$id]];
}
}
unset($map);
return $tree;
}
/**
* 一维数据数组生成数据树
* @param array $list 数据列表
* @param string $id ID Key
* @param string $pid 父ID Key
* @param string $path
* @param string $ppath
* @return array
*/
public static function arr2table(array $list, $id = 'id', $pid = 'pid', $path = 'path', $ppath = '')
{
$tree = [];
foreach (self::arr2tree($list, $id, $pid) as $attr) {
$attr[$path] = "{$ppath}-{$attr[$id]}";
$attr['sub'] = isset($attr['sub']) ? $attr['sub'] : [];
$attr['spl'] = str_repeat("&nbsp;&nbsp;&nbsp;├&nbsp;&nbsp;", substr_count($ppath, '-'));
$sub = $attr['sub'];
unset($attr['sub']);
$tree[] = $attr;
if (!empty($sub)) {
$tree = array_merge($tree, (array)self::arr2table($sub, $id, $pid, $path, $attr[$path]));
}
}
return $tree;
}
/**
* 获取数据树子ID
* @param array $list 数据列表
* @param int $id 起始ID
* @param string $key 子Key
* @param string $pkey 父Key
* @return array
*/
public static function getArrSubIds($list, $id = 0, $key = 'id', $pkey = 'pid')
{
$ids = [ intval($id) ];
foreach ($list as $vo) {
if (intval($vo[$pkey]) > 0 && intval($vo[$pkey]) === intval($id)) {
$ids = array_merge($ids, self::getArrSubIds($list, intval($vo[$key]), $key, $pkey));
}
}
return $ids;
}
/**
* Cors Options 授权处理
*/
public static function corsOptionsHandler()
{
if (request()->isOptions()) {
header('Access-Control-Allow-Origin:*');
header('Access-Control-Allow-Headers:Accept,Referer,Host,Keep-Alive,User-Agent,X-Requested-With,Cache-Control,Content-Type,Cookie,token');
header('Access-Control-Allow-Credentials:true');
header('Access-Control-Allow-Methods:GET,POST,OPTIONS');
header('Access-Control-Max-Age:1728000');
header('Content-Type:text/plain charset=UTF-8');
header('Content-Length: 0', true);
header('status: 204');
header('HTTP/1.0 204 No Content');
exit;
}
}
/**
* Cors Request Header信息
* @return array
*/
public static function corsRequestHander()
{
return [
'Access-Control-Allow-Origin' => '*',
'Access-Control-Allow-Credentials' => true,
'Access-Control-Allow-Methods' => 'GET,POST,OPTIONS',
'Access-Defined-X-Support' => 'service@cuci.cc',
'Access-Defined-X-Servers' => 'Guangzhou Cuci Technology Co. Ltd',
];
}
}
<?php
namespace app\api\extend;
/**
* Created by PhpStorm.
* User: zw
* Date: 2017/12/4
* Time: 9:35
* 基类
*/
use app\extra\RedisExt;
use app\model\Users;
use think\Controller;
use think\Exception;
use Think\Log;
use think\Request;
use think\Response;
use Qiniu;
use UnexpectedValueException;
use InvalidArgumentException;
class Basic extends Controller
{
/**
* 访问请求对象
* @var Request
*/
public $request;
public $params;
public $user_city;
protected $authToken;
/**
* @var int userId
*/
protected $userId;
protected $userNick;
protected $phone;
protected $timeStamp_;
protected $filterVerify = array(
"api/getShopList",
"api/sendSms",
"api/sendCode",
"api/userVerify",
"api/saveWxInfo",
"api/logout",
"api/login",
"api/register",
"api/shopList",
"api/filtrateCondition",
"api/filtrateConditionV2",
"api/getShopDetail",
"api/bannerList",
"api/averagePriceAndTurnover",
"api/getBroker",
"api/getBrokerV2",
"api/brokerDetail",
"api/commentAndDeal",
"api/check_code",
"api/convertOrderByTime",
"api/convertMarchIn",
"api/convertCollectingBill",
"api/getVersionNo",
"api/getVersionNoV2",
"api/getMarchInList",
"api/addSublet",
"api/getSiteListApp",
"api/recordCallNumShare",
"api/addUserCallAgentV2"
);
/**
* 基础接口SDK
* @param Request|null $request
*/
public function __construct(Request $request = null)
{
// CORS 跨域 Options 检测响应
$this->corsOptionsHandler();
// 输入对象
$this->request = is_null($request) ? Request::instance() : $request;
if (strtoupper($this->request->method()) === "GET") {
$this->params = $this->request->param();
} elseif (strtoupper($this->request->method()) === "POST") {
$this->params = $this->request->param() != null ? $this->request->param() : null;
}
if (isset($this->params['AuthToken']) && $this->params['AuthToken'] != 'null' && !empty($this->params['AuthToken'])) {
$jwt = new \Firebase\JWT\JWT();
try {
$result = $jwt->decode($this->params['AuthToken'], config('jwt_key'), array( 'HS256' )); //解码token
} catch( UnexpectedValueException $e) {
echo json_encode(array( "code" => "300", "msg" => "AuthToken parameter error!", "data" => [], "type" => "json" ));
exit;
} catch( InvalidArgumentException $e) {
echo json_encode(array( "code" => "300", "msg" => "AuthToken parameter error!", "data" => [], "type" => "json" ));
exit;
}
$this->authToken = $this->params['AuthToken'];
$this->userId = $result->data->id;
$this->phone = $result->data->phone;
$this->userNick = isset($result->data->userNick) ? $result->data->userNick : "";
$this->timeStamp_ = $result->timeStamp_;
}
$this->getCity($this->userId);
$requestPath = $this->request->routeInfo()["rule"][0] . "/" . $this->request->routeInfo()["rule"][1];
//过滤掉不需要验证token的接口
if (!in_array(trim($requestPath), $this->filterVerify)) {
$this->tokenVerify();
}
}
/**
* 默认城市选择
* @param $userId
*/
public function getCity($userId)
{
if(!$userId){
return;
}
try {
$redis_ = RedisExt::getRedis();
if ($redis_) {
$city = $redis_->get("user_city_" . $userId);
$this->user_city = empty($city) ? "上海市" : $city;
} else {
$this->user_city = "上海市";
}
Log::record("-------basic-------".$redis_->get("user_city_" . $userId),"info");
} catch (Exception $exception) {
$this->user_city = "上海市";
}
}
/**
* token 验证
*/
public function tokenVerify()
{
if (!isset($this->params['AuthToken'])) {
echo json_encode(array( "code" => "300", "msg" => "AuthToken不能为空!", "data" => [], "type" => "json" ));
exit;
}
$this->verifyUserInfo();
$this->verifyTime();
}
public function verifyTime()
{
//authToken有效期为30天
if ((time() - $this->timeStamp_) > 2592000) {
echo json_encode(array( "code" => "300", "msg" => "AuthToken失效,请重新登录!", "data" => [], "type" => "json" ));
exit;
}
}
public function verifyUserInfo()
{
$userModel = new Users();
$userArr = $userModel->selectUser($this->userId);
if (count($userArr) > 0 && ($userArr["id"] != $this->userId || $userArr["user_phone"] != $this->phone)) {
echo json_encode(array( "code" => "300", "msg" => "用户验证失败,重新登录!", "data" => [], "type" => "json" ));
exit;
}
return true;
}
/**
* 输出返回数据
* @param string $msg 提示消息内容
* @param string $code 业务状态码
* @param mixed $data 要返回的数据
* @param string $type 返回类型 JSON XML
* @return Response
*/
public function response($code = 'SUCCESS', $msg, $data = [], $type = 'json')
{
$result = [ 'code' => $code, 'msg' => $msg, 'data' => $data, 'type' => strtolower($type) ];
return Response::create($result, $type);
}
/**
* 一维数据数组生成数据树
* @param array $list 数据列表
* @param string $id 父ID Key
* @param string $pid ID Key
* @param string $son 定义子数据Key
* @return array
*/
public static function arr2tree($list, $id = 'id', $pid = 'pid', $son = 'sub')
{
list($tree, $map) = [ [], [] ];
foreach ($list as $item) {
$map[$item[$id]] = $item;
}
foreach ($list as $item) {
if (isset($item[$pid]) && isset($map[$item[$pid]])) {
$map[$item[$pid]][$son][] = &$map[$item[$id]];
} else {
$tree[] = &$map[$item[$id]];
}
}
unset($map);
return $tree;
}
/**
* 一维数据数组生成数据树
* @param array $list 数据列表
* @param string $id ID Key
* @param string $pid 父ID Key
* @param string $path
* @param string $ppath
* @return array
*/
public static function arr2table(array $list, $id = 'id', $pid = 'pid', $path = 'path', $ppath = '')
{
$tree = [];
foreach (self::arr2tree($list, $id, $pid) as $attr) {
$attr[$path] = "{$ppath}-{$attr[$id]}";
$attr['sub'] = isset($attr['sub']) ? $attr['sub'] : [];
$attr['spl'] = str_repeat("&nbsp;&nbsp;&nbsp;├&nbsp;&nbsp;", substr_count($ppath, '-'));
$sub = $attr['sub'];
unset($attr['sub']);
$tree[] = $attr;
if (!empty($sub)) {
$tree = array_merge($tree, (array)self::arr2table($sub, $id, $pid, $path, $attr[$path]));
}
}
return $tree;
}
/**
* 获取数据树子ID
* @param array $list 数据列表
* @param int $id 起始ID
* @param string $key 子Key
* @param string $pkey 父Key
* @return array
*/
public static function getArrSubIds($list, $id = 0, $key = 'id', $pkey = 'pid')
{
$ids = [ intval($id) ];
foreach ($list as $vo) {
if (intval($vo[$pkey]) > 0 && intval($vo[$pkey]) === intval($id)) {
$ids = array_merge($ids, self::getArrSubIds($list, intval($vo[$key]), $key, $pkey));
}
}
return $ids;
}
/**
* Cors Options 授权处理
*/
public static function corsOptionsHandler()
{
if (request()->isOptions()) {
header('Access-Control-Allow-Origin:*');
header('Access-Control-Allow-Headers:Accept,Referer,Host,Keep-Alive,User-Agent,X-Requested-With,Cache-Control,Content-Type,Cookie,token');
header('Access-Control-Allow-Credentials:true');
header('Access-Control-Allow-Methods:GET,POST,OPTIONS');
header('Access-Control-Max-Age:1728000');
header('Content-Type:text/plain charset=UTF-8');
header('Content-Length: 0', true);
header('status: 204');
header('HTTP/1.0 204 No Content');
exit;
}
}
/**
* Cors Request Header信息
* @return array
*/
public static function corsRequestHander()
{
return [
'Access-Control-Allow-Origin' => '*',
'Access-Control-Allow-Credentials' => true,
'Access-Control-Allow-Methods' => 'GET,POST,OPTIONS',
'Access-Defined-X-Support' => 'service@cuci.cc',
'Access-Defined-X-Servers' => 'Guangzhou Cuci Technology Co. Ltd',
];
}
}
......@@ -196,4 +196,24 @@ class MessageUntils
return false;
}
}
/**
* 对客户发送短信
* @param $phone
* @param string $templd = '226972'
* @return bool
*/
public function sendSMSForUser($phone,$data,$templd){
if((!$phone)or(!$data)or(!$templd)){
return false;
}
$message = new MessageUntils();
$result = $message->sendCCPSMS($phone,$data,$templd);
if ($result['statusCode'] == "000000") {
return true;
} else {
return false;
}
}
}
......@@ -23,6 +23,8 @@ use app\model\AAgents;
use app\model\ABindingDevice;
use app\model\ACollectUser;
use app\model\ASite;
use app\model\AuthGroup;
use app\model\AuthRule;
use app\model\ChatUserExt;
use app\model\Evaluate;
use app\model\GOperatingRecords;
......@@ -61,6 +63,8 @@ class Broker extends Basic
*/
public function login()
{
return $this->response(101, '请升级');
$data['data'] = [];
if (empty($this->params['phone']) && empty($this->params['pwd'])) {
......@@ -153,21 +157,30 @@ class Broker extends Basic
$status = 0;
$agents_data = $v;
break; //查找正常状态
} else {
$status = $v['status'];
}
}
if ($status == 4) {
return $this->response(101, '该账号已被列入黑名单!');
}
if ($status) {
foreach ($agents_data_list as $v) {
if ($v['status'] == 4) {
return $this->response(101, '该账号已被列入黑名单!');
break;
}
switch ($agents_data['status']) {
case 1 :
$msg = '您目前是长假状态,请联系人事进行更改';break;
case 2 :
$msg = '您目前是已离职状态,请联系人事进行更改。';break;
case 3 :
$msg = '您已转勤';break;
case 4 :
$msg = '该账号已被列入黑名单!';break;
case 5 :
$msg = '该账号已被冻结!';break;
default :
$msg = '帐号异常';
}
if ($msg) {
return $this->response(101, $msg);
}
return $this->response(101, '你目前是长假/离职状态,请联系人事进行更改');
}
if ($agents_data['password'] != md5($this->params['pwd'])) {
......@@ -221,6 +234,17 @@ class Broker extends Basic
// }
// }
// /*处理多个手机登录聊天*/
$m_auth_group = new AuthGroup();
$auth_group = $m_auth_group->getAuthGroup($data['data']['auth_group_id'], 'title,rules');
$m_rule = new AuthRule();
$id = $m_rule->getAuthRuleByName('index/dailyDetailsFinance', 'id');
$rules_arr = explode(',', $auth_group['rules']);
$data['data']['show_daily'] = 0;
if (in_array($id, $rules_arr)) {
$data['data']['show_daily'] = 1; //财务日报显示
}
return $this->response(200, $data['msg'], $data['data']);
}
......
......@@ -117,8 +117,12 @@ class DailyPaper extends Basic
$other_bank = $params["other_bank"];
$bank_card = $params["bank_card"];
$site_id = $this->siteId;
$bank_card_yun = $params["bank_card_yun"] ? $params["bank_card_yun"] : 0;
$bank_card_lin = $params["bank_card_lin"] ? $params["bank_card_lin"] : 0;
$bank_card_new = $params["bank_card_new"] ? $params["bank_card_new"] : 0;
$result = $this->service_->addDaily($agent_id, $agent_name, $daily_date, $alipay, $tenpay, $realty_pay,
$family_pay,$private_bank ,$cash, $pos, $other_bank, $tenpay_2, $alipay_2, $site_id, $bank_card);
$family_pay,$private_bank ,$cash, $pos, $other_bank, $tenpay_2, $alipay_2, $site_id, $bank_card,$bank_card_yun
,$bank_card_lin,$bank_card_new);
if ($result["code"] == 101) {
return $this->response("101", $result["msg"]);
} else {
......
......@@ -90,8 +90,8 @@ class HomePageLog extends Basic
}
if (!empty($params["start_time"]) && !empty($params["end_time"])) {
$time = strtotime($end_time) - strtotime($start_time);
if ($time > 1296000 || $time < 0) {
return $this->response(101, '搜索时间不能大于15天');
if ($time > 2592000 || $time < 0) {
return $this->response(101, '搜索时间不能大于30天');
}
$where_["create_time"] = array( 'between', array( $start_time, $end_time ) );
......@@ -202,8 +202,8 @@ class HomePageLog extends Basic
$end_time = date("Y-m-d H:i:s", $params["end_time"]);
$time = strtotime($end_time) - strtotime($start_time);
if ($time > 1296000 || $time < 0) {
return $this->response(101, '搜索时间不能大于15天');
if ($time > 2592000 || $time < 0) {
return $this->response(101, '搜索时间不能大于30天');
}
$where_["f.create_time"] = array( 'between', array( $start_time, $end_time ) );
}
......
......@@ -3,6 +3,7 @@
namespace app\api_broker\controller;
use app\api\service\PushClientService;
use app\api\untils\MessageUntils;
use app\api_broker\extend\Basic;
use app\api_broker\service\HouseNumUpdateService;
use app\api_broker\service\OrderLogService;
......@@ -16,6 +17,7 @@ use app\model\OImg;
use app\model\OMarchInModel;
use app\model\OrderModel;
use app\model\ORefundModel;
use app\model\OReportModel;
use think\Exception;
use Think\Log;
......@@ -132,6 +134,9 @@ class OrderLog extends Basic
//评价经纪人
$push_client = new PushClientService();
$push_client->record((int)$params["report_id"], (int)$params["order_id"], 0, '', (int)$this->agentId);
//对客户发送短信通知 7151
$this->sendSMSForUser($params["report_id"]);
return $this->response("200", "request success", []);
} else {
return $this->response("101", "request faild");
......@@ -140,6 +145,24 @@ class OrderLog extends Basic
}
/**
* 对客户发送短信通知
* @param $report_id
* @return bool
*/
public function sendSMSForUser($report_id){
$report = new OReportModel();
$messageUntil = new MessageUntils();
$user_phone = $report->getFieldValue('user_phone', ['id'=>$report_id]);
$result = $messageUntil->sendSMSForUser($user_phone,[SMS_TEMPLATE_URL],'415209');
if ($result == 'true') {
return true;
} else {
return false;
}
}
/**
* 收款
* @return \think\Response
......
......@@ -48,15 +48,15 @@ class Performance extends Basic
return $this->response("101", "请求参数错误");
}
//默认排序一周 2018-07-18改为本月
$end_day = !empty($params["end_day"]) ? $params["end_day"] : date("Y-m-d", time());
$end_day = !empty($params["end_day"]) ? $params["end_day"] : date("Y-m-d", time());
$start_day = !empty($params["start_day"]) ? $params["start_day"] : date("Y-m-01", time());
$list = $this->service_->totalAgent($params["agent_id"], $params["type"], $start_day, $end_day,$params["site_id"]);
$list = $this->service_->totalAgent($params["agent_id"], $params["type"], $start_day, $end_day, $params["site_id"]);
if (count($list) > 0) {
$result["list"] = $list;
$result["list"] = $list;
$result["start_time"] = $start_day;
$result["end_time"] = $end_day;
$result["end_time"] = $end_day;
return $this->response("200", "request success", $result);
}
return $this->response("200", "request null");
......@@ -86,7 +86,7 @@ class Performance extends Basic
$house_id = $params["house_id"];
}
try {
$result = $this->service_->personagePerformance($params["agent_id"], $params["start_time"], $params["end_time"] ." 23:59:59",
$result = $this->service_->personagePerformance($params["agent_id"], $params["start_time"], $params["end_time"] . " 23:59:59",
$params["is_case"], $house_id);
return $this->response("200", "request success", $result);
} catch (Exception $exception) {
......@@ -108,11 +108,11 @@ class Performance extends Basic
"start_time" => "2018-06-25",
"end_time" => "2018-06-25",
);*/
if (!isset($params["agent_id"]) || !isset($params["site_id"])) {
if (!isset($params["agent_id"]) || !isset($params["site_id"])) {
return $this->response("101", "请求参数错误");
}
try {
$result = $this->service_->storePerformance($params["agent_id"], $params["start_time"], $params["end_time"]." 23:59:59",$params["site_id"]);
$result = $this->service_->storePerformance($params["agent_id"], $params["start_time"], $params["end_time"] . " 23:59:59", $params["site_id"]);
return $this->response("200", "request success", $result);
} catch (Exception $exception) {
return $this->response("101", "request error,msg:" . $exception);
......@@ -127,14 +127,14 @@ class Performance extends Basic
{
header('Access-Control-Allow-Origin:*');
$params = $this->params;
/* $params = array(
"agent_id" => 5740,
"start_time" => "2018-08-08",
"end_time" => "2018-08-08",
"is_case" => 2,//1经纪人 2案场
"house_id" => 7311,
"type" => 4 // 1带看 2进场 3收款 4成交报告
);*/
/* $params = array(
"agent_id" => 5740,
"start_time" => "2018-08-08",
"end_time" => "2018-08-08",
"is_case" => 2,//1经纪人 2案场
"house_id" => 7311,
"type" => 4 // 1带看 2进场 3收款 4成交报告
);*/
if (!isset($params["agent_id"]) || !isset($params["start_time"]) || !isset($params["end_time"]) || !isset($params["type"])) {
return $this->response("101", "请求参数错误");
}
......@@ -168,14 +168,14 @@ class Performance extends Basic
"end_time" => "2018-04-12",
);*/
if (!isset($params["agent_id"]) || !isset($params["start_time"]) || !isset($params["end_time"] )|| !isset($params["site_id"])) {
if (!isset($params["agent_id"]) || !isset($params["start_time"]) || !isset($params["end_time"]) || !isset($params["site_id"])) {
return $this->response("101", "请求参数错误");
}
Log::write($params, 'storeOrAgentSort'); //记录日志
//城市选择
$site_id = $params["site_id"]? $params["site_id"]: '';
$site_id = $params["site_id"] ? $params["site_id"] : '';
try {
$result = $this->service_->storeSortByDistrictId($params["agent_id"], $params["is_store"], $params["start_time"], $params["end_time"]." 23:59:59",$site_id);
$result = $this->service_->storeSortByDistrictId($params["agent_id"], $params["is_store"], $params["start_time"], $params["end_time"] . " 23:59:59", $site_id);
return $this->response("200", "request success", $result);
} catch (Exception $exception) {
......@@ -205,10 +205,10 @@ class Performance extends Basic
return $this->response("101", $checkResult);
}
//默认排序一周
$end_day = !empty($params["end_time"]) ? $params["end_time"] : date("Y-m-d", strtotime("-1 day"));
$end_day = !empty($params["end_time"]) ? $params["end_time"] : date("Y-m-d", strtotime("-1 day"));
$start_day = !empty($params["start_time"]) ? $params["start_time"] : date("Y-m-d", strtotime("-7 day"));
$page_no = empty($params['page_no']) ? 1 : $params['page_no'];
$page_no = empty($params['page_no']) ? 1 : $params['page_no'];
$page_size = empty($params['page_size']) ? 15 : $params['page_size'];
$result = $this->service_->getHousingResourceList($params["type"], $params["agent_id"], $start_day, $end_day, $page_no, $page_size);
......@@ -241,10 +241,10 @@ class Performance extends Basic
return $this->response("101", $checkResult);
}
//默认排序一周
$end_day = !empty($params["end_time"]) ? $params["end_time"] : date("Y-m-d", strtotime("-1 day"));
$end_day = !empty($params["end_time"]) ? $params["end_time"] : date("Y-m-d", strtotime("-1 day"));
$start_day = !empty($params["start_time"]) ? $params["start_time"] : date("Y-m-d", strtotime("-7 day"));
$page_no = empty($params['page_no']) ? 1 : $params['page_no'];
$page_no = empty($params['page_no']) ? 1 : $params['page_no'];
$page_size = empty($params['page_size']) ? 15 : $params['page_size'];
$result = $this->service_->getUserResourceList($params["type"], $params["agent_id"], $start_day, $end_day, $page_no, $page_size);
......@@ -277,10 +277,10 @@ class Performance extends Basic
return $this->response("101", $checkResult);
}
//默认排序一周
$end_day = !empty($params["end_time"]) ? $params["end_time"] : date("Y-m-d", strtotime("-1 day"));
$end_day = !empty($params["end_time"]) ? $params["end_time"] : date("Y-m-d", strtotime("-1 day"));
$start_day = !empty($params["start_time"]) ? $params["start_time"] : date("Y-m-d", strtotime("-7 day"));
$page_no = empty($params['page_no']) ? 1 : $params['page_no'];
$page_no = empty($params['page_no']) ? 1 : $params['page_no'];
$page_size = empty($params['page_size']) ? 15 : $params['page_size'];
$result = $this->service_->getFollowList($params["agent_id"], $start_day, $end_day, $page_no, $page_size);
......@@ -299,23 +299,23 @@ class Performance extends Basic
{
header('Access-Control-Allow-Origin:*');
$params = $this->params;
/* $params = array(
"agent_id" => 80,
"start_time" => "2018-06-12",
"end_time" => "2018-06-19",
"page_no" => 1,
"page_size" => 15
);*/
/* $params = array(
"agent_id" => 80,
"start_time" => "2018-06-12",
"end_time" => "2018-06-19",
"page_no" => 1,
"page_size" => 15
);*/
$checkResult = $this->validate($params, "PerformanceValidate.verifyOther");
if (true !== $checkResult) {
return $this->response("101", $checkResult);
}
//默认排序一周
$end_day = !empty($params["end_time"]) ? $params["end_time"] : date("Y-m-d", strtotime("-1 day"));
$end_day = !empty($params["end_time"]) ? $params["end_time"] : date("Y-m-d", strtotime("-1 day"));
$start_day = !empty($params["start_time"]) ? $params["start_time"] : date("Y-m-d", strtotime("-7 day"));
$page_no = empty($params['page_no']) ? 1 : $params['page_no'];
$page_no = empty($params['page_no']) ? 1 : $params['page_no'];
$page_size = empty($params['page_size']) ? 15 : $params['page_size'];
$result = $this->service_->marchInList($params["agent_id"], $start_day, $end_day, $page_no, $page_size);
......@@ -347,10 +347,10 @@ class Performance extends Basic
return $this->response("101", $checkResult);
}
//默认排序一周
$end_day = !empty($params["end_time"]) ? $params["end_time"] : date("Y-m-d", strtotime("-1 day"));
$end_day = !empty($params["end_time"]) ? $params["end_time"] : date("Y-m-d", strtotime("-1 day"));
$start_day = !empty($params["start_time"]) ? $params["start_time"] : date("Y-m-d", strtotime("-7 day"));
$page_no = empty($params['page_no']) ? 1 : $params['page_no'];
$page_no = empty($params['page_no']) ? 1 : $params['page_no'];
$page_size = empty($params['page_size']) ? 15 : $params['page_size'];
$result = $this->service_->paylogList($params["agent_id"], $start_day, $end_day, $page_no, $page_size);
......@@ -369,24 +369,24 @@ class Performance extends Basic
{
header('Access-Control-Allow-Origin:*');
$params = $this->params;
/* $params = array(
"type" => 1, //1个人,2经纪人
"agent_id" => 80,
"start_time" => "2018-06-12",
"end_time" => "2018-06-19",
"page_no" => 1,
"page_size" => 15
);*/
/* $params = array(
"type" => 1, //1个人,2经纪人
"agent_id" => 80,
"start_time" => "2018-06-12",
"end_time" => "2018-06-19",
"page_no" => 1,
"page_size" => 15
);*/
$checkResult = $this->validate($params, "PerformanceValidate.verify");
if (true !== $checkResult) {
return $this->response("101", $checkResult);
}
//默认排序一周
$end_day = !empty($params["end_time"]) ? $params["end_time"] : date("Y-m-d", strtotime("-1 day"));
$end_day = !empty($params["end_time"]) ? $params["end_time"] : date("Y-m-d", strtotime("-1 day"));
$start_day = !empty($params["start_time"]) ? $params["start_time"] : date("Y-m-d", strtotime("-7 day"));
$page_no = empty($params['page_no']) ? 1 : $params['page_no'];
$page_no = empty($params['page_no']) ? 1 : $params['page_no'];
$page_size = empty($params['page_size']) ? 15 : $params['page_size'];
$result = $this->service_->performanceList($params["type"], $params["agent_id"], $start_day, $end_day, $page_no, $page_size);
......@@ -418,10 +418,10 @@ class Performance extends Basic
return $this->response("101", $checkResult);
}
//默认排序一周
$end_day = !empty($params["end_time"]) ? $params["end_time"] : date("Y-m-d", strtotime("-1 day"));
$end_day = !empty($params["end_time"]) ? $params["end_time"] : date("Y-m-d", strtotime("-1 day"));
$start_day = !empty($params["start_time"]) ? $params["start_time"] : date("Y-m-d", strtotime("-7 day"));
$page_no = empty($params['page_no']) ? 1 : $params['page_no'];
$page_no = empty($params['page_no']) ? 1 : $params['page_no'];
$page_size = empty($params['page_size']) ? 15 : $params['page_size'];
$result = $this->service_->superviseList($params["agent_id"], $start_day, $end_day, $page_no, $page_size);
......@@ -454,10 +454,10 @@ class Performance extends Basic
return $this->response("101", $checkResult);
}
//默认排序一周
$end_day = !empty($params["end_time"]) ? $params["end_time"] : date("Y-m-d", strtotime("-1 day"));
$end_day = !empty($params["end_time"]) ? $params["end_time"] : date("Y-m-d", strtotime("-1 day"));
$start_day = !empty($params["start_time"]) ? $params["start_time"] : date("Y-m-d", strtotime("-7 day"));
$page_no = empty($params['page_no']) ? 1 : $params['page_no'];
$page_no = empty($params['page_no']) ? 1 : $params['page_no'];
$page_size = empty($params['page_size']) ? 15 : $params['page_size'];
$result = $this->service_->officialReceipts($params["type"], $params["agent_id"], $start_day, $end_day, $page_no, $page_size);
......@@ -468,12 +468,6 @@ class Performance extends Basic
}
}
/**
* 获取时间段实收数据
* @return \think\Response
......@@ -484,13 +478,13 @@ class Performance extends Basic
$params = $this->params;
//默认排序一周
$end_day = !empty($params["end_time"]) ? $params["end_time"] : date("Y-m-d", strtotime("-1 day"));
$end_day = !empty($params["end_time"]) ? $params["end_time"] : date("Y-m-d", strtotime("-1 day"));
$start_day = !empty($params["start_time"]) ? $params["start_time"] : date("Y-m-d", strtotime("-7 day"));
$page_no = empty($params['page_no']) ? 1 : $params['page_no'];
$page_no = empty($params['page_no']) ? 1 : $params['page_no'];
$page_size = empty($params['page_size']) ? 15 : $params['page_size'];
$result = $this->service_->paylogListPcInfo($params["id"],$params["type"], $start_day, $end_day, $page_no, $page_size);
$result = $this->service_->paylogListPcInfo($params["id"], $params["type"], $start_day, $end_day, $page_no, $page_size);
if ($result["code"] == 101) {
return $this->response("101", $result["date"]);
......@@ -508,18 +502,18 @@ class Performance extends Basic
header('Access-Control-Allow-Origin:*');
$params = $this->params;
//默认排序一周
$end_day = !empty($params["end_time"]) ? $params["end_time"] : date("Y-m-d", strtotime("-1 day"));
$end_day = !empty($params["end_time"]) ? $params["end_time"] : date("Y-m-d", strtotime("-1 day"));
$start_day = !empty($params["start_time"]) ? $params["start_time"] : date("Y-m-d", strtotime("-7 day"));
$page_no = empty($params['page_no']) ? 1 : $params['page_no'];
$page_no = empty($params['page_no']) ? 1 : $params['page_no'];
$page_size = empty($params['page_size']) ? 15 : $params['page_size'];
$result = $this->service_->marchInListPcInfo($params["id"],$params["type"], $start_day, $end_day, $page_no, $page_size);
$result = $this->service_->marchInListPcInfo($params["id"], $params["type"], $start_day, $end_day, $page_no, $page_size);
if ($result["code"] == 101) {
return $this->response("101", $result["date"]);
} else {
// return $this->response("200", "success", $result["date"]);
return $this->response("200", "success", [ "date" => $result["date"] , "total" => $result["total"] ]);
return $this->response("200", "success", ["date" => $result["date"], "total" => $result["total"]]);
}
}
......@@ -533,28 +527,28 @@ class Performance extends Basic
header('Access-Control-Allow-Origin:*');
$params = $this->params;
/* $params = array(
"id" => 80,
"type" => 1, //1表示个人业绩排行 2门店79 3区域7
"start_time" => "2018-06-12",
"end_time" => "2018-06-19",
"page_no" => 1,
"page_size" => 15
);*/
/* $params = array(
"id" => 80,
"type" => 1, //1表示个人业绩排行 2门店79 3区域7
"start_time" => "2018-06-12",
"end_time" => "2018-06-19",
"page_no" => 1,
"page_size" => 15
);*/
//默认排序一周
$end_day = !empty($params["end_time"]) ? $params["end_time"] : date("Y-m-d", strtotime("-1 day"));
$end_day = !empty($params["end_time"]) ? $params["end_time"] : date("Y-m-d", strtotime("-1 day"));
$start_day = !empty($params["start_time"]) ? $params["start_time"] : date("Y-m-d", strtotime("-7 day"));
$page_no = empty($params['page_no']) ? 1 : $params['page_no'];
$page_no = empty($params['page_no']) ? 1 : $params['page_no'];
$page_size = empty($params['page_size']) ? 15 : $params['page_size'];
$result = $this->service_->getFollowListPcInfo($params["id"],$params["type"], $start_day, $end_day, $page_no, $page_size);
$result = $this->service_->getFollowListPcInfo($params["id"], $params["type"], $start_day, $end_day, $page_no, $page_size);
if ($result["code"] == 101) {
return $this->response("101", $result["date"]);
} else {
//return $this->response("200", "success", $result["date"]);
return $this->response("200", "success", [ "date" => $result["date"] , "total" => $result["total"] ]);
return $this->response("200", "success", ["date" => $result["date"], "total" => $result["total"]]);
}
}
......@@ -570,14 +564,14 @@ class Performance extends Basic
$params = $this->params;
//默认排序一周
$end_day = !empty($params["end_time"]) ? $params["end_time"] : date("Y-m-d", strtotime("-1 day"));
$end_day = !empty($params["end_time"]) ? $params["end_time"] : date("Y-m-d", strtotime("-1 day"));
$start_day = !empty($params["start_time"]) ? $params["start_time"] : date("Y-m-d", strtotime("-7 day"));
$page_no = empty($params['page_no']) ? 1 : $params['page_no'];
$page_no = empty($params['page_no']) ? 1 : $params['page_no'];
$page_size = empty($params['page_size']) ? 15 : $params['page_size'];
//todo 最后跟进时间
$result = $this->service_->getHousingResourceListPcInfo($params["id"],$params["type"], $start_day, $end_day, $page_no, $page_size);
$result = $this->service_->getHousingResourceListPcInfo($params["id"], $params["type"], $start_day, $end_day, $page_no, $page_size);
if ($result["code"] == 101) {
return $this->response("101", $result["date"]);
} else {
......@@ -596,14 +590,14 @@ class Performance extends Basic
$params = $this->params;
//默认排序一周
$end_day = !empty($params["end_time"]) ? $params["end_time"] : date("Y-m-d", strtotime("-1 day"));
$end_day = !empty($params["end_time"]) ? $params["end_time"] : date("Y-m-d", strtotime("-1 day"));
$start_day = !empty($params["start_time"]) ? $params["start_time"] : date("Y-m-d", strtotime("-7 day"));
$page_no = empty($params['page_no']) ? 1 : $params['page_no'];
$page_no = empty($params['page_no']) ? 1 : $params['page_no'];
$page_size = empty($params['page_size']) ? 15 : $params['page_size'];
$result = $this->service_->getUserResourceListPcInfo($params["id"],$params["type"], $start_day, $end_day,
$page_no, $page_size,$this->siteId);
$result = $this->service_->getUserResourceListPcInfo($params["id"], $params["type"], $start_day, $end_day,
$page_no, $page_size, $this->siteId);
if ($result["code"] == 101) {
return $this->response("101", $result["date"]);
} else {
......@@ -622,13 +616,13 @@ class Performance extends Basic
$params = $this->params;
//默认排序一周
$end_day = !empty($params["end_time"]) ? $params["end_time"] : date("Y-m-d", strtotime("-1 day"));
$end_day = !empty($params["end_time"]) ? $params["end_time"] : date("Y-m-d", strtotime("-1 day"));
$start_day = !empty($params["start_time"]) ? $params["start_time"] : date("Y-m-d", strtotime("-7 day"));
$page_no = empty($params['page_no']) ? 1 : $params['page_no'];
$page_no = empty($params['page_no']) ? 1 : $params['page_no'];
$page_size = empty($params['page_size']) ? 15 : $params['page_size'];
// dump($params);
$result = $this->service_->getTeamNumPcInfo($params["id"],$params["type"], $page_no, $page_size,$this->siteId);
$result = $this->service_->getTeamNumPcInfo($params["id"], $params["type"], $page_no, $page_size, $this->siteId);
if ($result["code"] == 101) {
return $this->response("101", $result["date"]);
} else {
......@@ -646,17 +640,17 @@ class Performance extends Basic
$params = $this->params;
//默认排序一周
$end_day = !empty($params["end_time"]) ? $params["end_time"] : date("Y-m-d", strtotime("-1 day"));
$end_day = !empty($params["end_time"]) ? $params["end_time"] : date("Y-m-d", strtotime("-1 day"));
$start_day = !empty($params["start_time"]) ? $params["start_time"] : date("Y-m-d", strtotime("-7 day"));
$page_no = empty($params['page_no']) ? 1 : $params['page_no'];
$page_no = empty($params['page_no']) ? 1 : $params['page_no'];
$page_size = empty($params['page_size']) ? 15 : $params['page_size'];
//request_source_type true int 请求来源默认0:App 1:PC后台
$request_source_type = !empty($params["request_source_type"]) ? $params["request_source_type"] : 0;
$result = $this->service_->getBargainSumPcInfo($params["id"],$params["type"], $start_day, $end_day, $page_no, $page_size,$request_source_type);
$result = $this->service_->getBargainSumPcInfo($params["id"], $params["type"], $start_day, $end_day, $page_no, $page_size, $request_source_type);
if ($result["code"] == 101) {
return $this->response("101", $result["date"]);
} else {
......@@ -664,4 +658,30 @@ class Performance extends Basic
}
}
/**
* 收款信息
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* http://showdoc.tonglianjituan.com/index.php?s=/1&page_id=815
*/
public function collectionListByBargainId()
{
header('Access-Control-Allow-Origin:*');
$params = $this->params;
/* $params = array(
"bargain_id" => 121,
);*/
$checkResult = $this->validate($params, "PerformanceValidate.verifyCollectionList");
if (true !== $checkResult) {
return $this->response("101", $checkResult);
}
$result = $this->service_->collectionList($params["bargain_id"]);
return $this->response("200", "success", $result);
}
}
......@@ -131,13 +131,23 @@ class Report extends Basic
$params["report_agent_id"] = $params["agent_id"];
$result = [];
if(isset($params["is_all"]) && $params["is_all"] == 1){
$vip = new VipService();
$check = $vip->vip($this->agentId, 'index/inspectionRecordAll');
if ($check) {
$check_type = $this->service_->getCheckType($this->agentId);
if ($check_type == 0) {
return $this->response(101, "暂无权限");
}
$result = $this->service_->orderListAll($field, $params, $pageNo, $pageSize);
$result = $this->service_->orderListAll($field, $params, $pageNo, $pageSize,$check_type);
}else{
$result = $this->service_->orderList($field, $params, $pageNo, $pageSize);
}
......@@ -149,6 +159,22 @@ class Report extends Basic
}
}
/**
* 获取权限
* @return int|\think\Response
*/
public function getCheckType()
{
$result = $this->service_->getCheckType($this->agentId);
if ($result == 0) {
return $this->response(101, "暂无权限");
} else {
return $this->response("200", "request success", ['check_type'=>$result]);
}
}
/**
* 获取报备列表 pc
* @return \think\Response
......@@ -183,9 +209,8 @@ class Report extends Basic
$params["a.id"] = $params["report_id"];
}
$params["report_agent_id"] = $params["agent_id"];
$result = $this->service_->orderListForPc($field, $params, $pageNo, $pageSize);
// $result = $this->service_->orderListForPc($field, $params, $pageNo, $pageSize);
$result = $this->service_->orderList($field, $params, $pageNo, $pageSize);
if (count($result) > 0) {
return $this->response("200", "request success", $result);
} else {
......
......@@ -109,7 +109,7 @@ class Basic extends Controller
$requestPath = $this->request->routeInfo()["rule"][0] . "/" . $this->request->routeInfo()["rule"][1];
//过滤掉不需要验证token的接口
if (!in_array(trim($requestPath), $this->filterVerify)) {
$this->tokenVerify();
$this->tokenVerify();
//$this->userAuth(trim($requestPath));
}
unset($this->params["AuthToken"]);
......
......@@ -5,6 +5,7 @@ namespace app\api_broker\service;
use app\api_broker\controller\Agent;
use app\api_broker\service\VerifyService;
use app\model\AAgents;
use app\model\AStore;
use app\model\GHouses;
use app\model\GHousesToAgents;
use app\model\ODaily;
......@@ -73,9 +74,14 @@ class DailyPaperService
$result["is_commit"] = 1;
switch ($is_store) {
case 0:
if ($agent_info["level"] != 20 && $agent_info["level"] != 40) {
return ["code" => 101, "msg" => "非店长不能查看日报"];
}
// if ($agent_info["level"] != 20 && $agent_info["level"] != 40) {
// return ["code" => 101, "msg" => "非店长不能查看日报"];
// }
$check_data = $this->checkAgent($agent_info['id']);
if ($check_data['code'] != 200) {
return ["code" => 101, "msg" => $check_data['msg']];
}
//证明店长提交过
if (count($daily_info) > 0) {
$result["commit_info"] = $daily_info[0];
......@@ -176,6 +182,10 @@ class DailyPaperService
$total["cash"] = 0;
$total["other_bank"] = 0;
$total["bank_card"] = 0;
//71 筠姐上海银行卡 72林老师建行卡 73新同联福居银行卡
$total["bank_card_yun"] = 0;
$total["bank_card_lin"] = 0;
$total["bank_card_new"] = 0;
if (count($total_arr) <= 0) {
return $total;
}
......@@ -220,6 +230,15 @@ class DailyPaperService
case 70:
$total["bank_card"] = $item["money"];
break;
case 71:
$total["bank_card_yun"] = $item["money"];
break;
case 72:
$total["bank_card_lin"] = $item["money"];
break;
case 73:
$total["bank_card_new"] = $item["money"];
break;
}
}
return $total;
......@@ -242,7 +261,7 @@ class DailyPaperService
}
$payLogModel = new OPayLogModel();
//中介费入账
$field = "a.id,c.id as bargain_id,b.house_id,c.price,a.money,a.pay_type,a.transfer_name,a.type,a.type_ext,
$field = "a.id,c.id as bargain_id,b.house_id,c.price,a.money,a.pay_type,a.transfer_name,a.type,a.type_ext,a.income_time,
d.report_agent_id as agent_id,c.is_open,a.is_dividend,a.receipt_number,a.create_time,a.remark,a.received_money";
$params["a.agent_id"] = array("in", ($ids));
$params["a.create_time"] = array("between", array($daily_data, $daily_data . " 23:59:59"));
......@@ -262,7 +281,7 @@ class DailyPaperService
$field_money = "a.id,a.money,a.type,a.type_ext,b.house_id,b.id as order_id,a.pay_type,a.transfer_name, d.report_agent_id as agent_id,
a.is_dividend,a.receipt_number,a.create_time";
a.is_dividend,a.receipt_number,a.create_time,a.income_time";
//意向金
$params["a.type"] = 10;
unset($params["c.father_id"]);
......@@ -469,14 +488,19 @@ class DailyPaperService
* @throws \think\exception\DbException
*/
public function addDaily($agent_id, $agent_name, $daily_date, $alipay, $tenpay, $realty_pay,
$family_pay, $private_bank, $cash, $pos, $other_bank, $tenpay_2, $alipay_2, $site_id, $bank_card)
$family_pay, $private_bank, $cash, $pos, $other_bank, $tenpay_2, $alipay_2, $site_id, $bank_card,
$bank_card_yun ,$bank_card_lin,$bank_card_new)
{
$agent_info_arr["agent_id"] = $agent_id;
$agent_info_field = "id,name,store_id,district_id,level";
$agent_info = $this->aAgentsModel->getAgentById($agent_info_field, $agent_info_arr);
if (count($agent_info) <= 0 || ($agent_info[0]["level"] != 20 && $agent_info[0]["level"] != 40)) {
return ["code" => 101, "msg" => "经纪人信息错误"];
$check_rule = new VipService();
$is = $check_rule->checkRule($agent_id, "commitDaily");
if ($is) {
return ["code" => 101, "msg" => "没有提交财务日报权限"];
}
}
//todo 判断是否提交过,
$dailyInfo = $this->getDailyInfo($agent_id,$daily_date,1);
......@@ -484,7 +508,8 @@ class DailyPaperService
return ["code" => 101, "msg" => "请勿重复提交日报"];
}
$params = $this->dailyBin($agent_id, $agent_name, $daily_date, $alipay, $tenpay, $realty_pay,
$family_pay, $private_bank, $cash, $pos, $other_bank, $agent_info[0]["store_id"], $agent_info[0]["district_id"], $tenpay_2, $alipay_2, $site_id, $bank_card);
$family_pay, $private_bank, $cash, $pos, $other_bank, $agent_info[0]["store_id"], $agent_info[0]["district_id"],
$tenpay_2, $alipay_2, $site_id, $bank_card,$bank_card_yun ,$bank_card_lin,$bank_card_new);
$is_ok = $this->oDailyModel->addDaily($params);
if ($is_ok > 0) {
return ["code" => 200, "data" => null];
......@@ -493,8 +518,9 @@ class DailyPaperService
}
}
public function dailyBin($agent_id, $agent_name, $daily_date, $alipay, $tenpay, $realty_pay,
$family_pay, $private_bank, $cash, $pos, $other_bank, $store_id, $district_id, $tenpay_2, $alipay_2, $site_id, $bank_card)
public function dailyBin($agent_id, $agent_name, $daily_date, $alipay, $tenpay, $realty_pay, $family_pay, $private_bank,
$cash, $pos, $other_bank, $store_id, $district_id, $tenpay_2, $alipay_2, $site_id, $bank_card,
$bank_card_yun ,$bank_card_lin,$bank_card_new)
{
$arr["agent_id"] = $agent_id;
$arr["agent_name"] = $agent_name;
......@@ -513,11 +539,15 @@ class DailyPaperService
$arr["tenpay_2"] = $tenpay_2;
$arr["alipay_2"] = $alipay_2;
$arr["site_id"] = $site_id;
$arr["bank_card_yun"] = $bank_card_yun;
$arr["bank_card_lin"] = $bank_card_lin;
$arr["bank_card_new"] = $bank_card_new;
$arr["create_time"] = date("Y-m-d H:i:s", time());
$arr["update_time"] = date("Y-m-d H:i:s", time());
return $arr;
}
/**
* @param $daily_id
* @param $agent_id
......@@ -532,13 +562,20 @@ class DailyPaperService
* @param $other_bank
* @param $remark
* @param $operation_status
* @return array|int
* @param $tenpay_2
* @param $alipay_2
* @param $bank_card
* @param $bank_card_yun
* @param $bank_card_lin
* @param $bank_card_new
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function addDailyCheck($daily_id, $agent_id, $agent_name, $alipay, $tenpay, $realty_pay,
$family_pay, $private_bank, $cash, $pos, $other_bank, $remark,$operation_status, $tenpay_2, $alipay_2, $bank_card)
public function addDailyCheck($daily_id, $agent_id, $agent_name, $alipay, $tenpay, $realty_pay, $family_pay, $private_bank,
$cash, $pos, $other_bank, $remark,$operation_status, $tenpay_2, $alipay_2, $bank_card,
$bank_card_yun ,$bank_card_lin,$bank_card_new)
{
$agent_info_arr["agent_id"] = $agent_id;
$agent_info_field = "id,name,store_id,district_id,level";
......@@ -554,7 +591,8 @@ class DailyPaperService
return ["code" => 101, "msg" => "您已经审核过了"];
}
$params = $this->dailyLogBin($daily_id, $agent_id, $agent_name, $alipay, $tenpay, $realty_pay,
$family_pay, $private_bank, $cash, $pos, $other_bank, $remark,$operation_status, $tenpay_2, $alipay_2, $bank_card);
$family_pay, $private_bank, $cash, $pos, $other_bank, $remark,$operation_status, $tenpay_2, $alipay_2, $bank_card,
$bank_card_yun ,$bank_card_lin,$bank_card_new);
$is_ok = $this->oDailyLogModel->addDailyCheck($params);
......@@ -588,10 +626,17 @@ class DailyPaperService
* @param $other_bank
* @param $remark
* @param $operation_status
* @param $tenpay_2
* @param $alipay_2
* @param $bank_card
* @param $bank_card_yun
* @param $bank_card_lin
* @param $bank_card_new
* @return mixed
*/
public function dailyLogBin($daily_id, $agent_id, $agent_name, $alipay, $tenpay, $realty_pay,
$family_pay, $private_bank, $cash, $pos, $other_bank, $remark,$operation_status, $tenpay_2, $alipay_2, $bank_card)
public function dailyLogBin($daily_id, $agent_id, $agent_name, $alipay, $tenpay, $realty_pay,$family_pay, $private_bank,
$cash, $pos, $other_bank, $remark,$operation_status, $tenpay_2, $alipay_2, $bank_card,
$bank_card_yun ,$bank_card_lin,$bank_card_new)
{
$arr["daily_id"] = $daily_id;
$arr["operation_id"] = $agent_id;
......@@ -609,6 +654,9 @@ class DailyPaperService
$arr["tenpay_2"] = $tenpay_2;
$arr["alipay_2"] = $alipay_2;
$arr["bank_card"] = $bank_card;
$arr["bank_card_yun"] = $bank_card_yun;
$arr["bank_card_lin"] = $bank_card_lin;
$arr["bank_card_new"] = $bank_card_new;
$arr["create_time"] = date("Y-m-d H:i:s", time());
$arr["update_time"] = date("Y-m-d H:i:s", time());
return $arr;
......@@ -628,7 +676,7 @@ class DailyPaperService
private function getDailyInfo($store_id, $daily_data,$type = 0)
{
$field_info_field = "id,agent_id,agent_name,daily_date,alipay,tenpay,realty_pay,family_pay,private_bank,
cash,pos,other_bank,status,create_time,update_time,alipay_2,tenpay_2,site_id,bank_card";
cash,pos,other_bank,status,create_time,update_time,alipay_2,tenpay_2,site_id,bank_card,bank_card_yun,bank_card_lin,bank_card_new";
if($type == 1){
$daily_info_params["agent_id"] = $store_id;
}else{
......@@ -668,4 +716,22 @@ class DailyPaperService
return $result;
}
/**
* 检查用户权限
*
* @param $agent_id
* @param $store_id
* @param $district_id
* @return array
*/
public function checkAgent($agent_id) {
$check_rule = new VipService();
$is_ = $check_rule->checkRule($agent_id, 'index/dailyDetail');
if ($is_) {
$result = ["code"=>101, "msg"=>"没有查看财务日报权限"];
} else {
$result = ["code"=>200];
}
return $result;
}
}
\ No newline at end of file
......@@ -2,6 +2,7 @@
namespace app\api_broker\service;
use app\model\AAgents;
use app\model\AuthGroup;
use app\model\AuthRule;
/**
* Created by PhpStorm.
......@@ -62,8 +63,18 @@ class MyCenterService{
if (!empty($result['auth_group_id'])) {
$m_auth_group = new AuthGroup();
$auth_group_name = $m_auth_group->getValue('title', ['id'=>$result['auth_group_id']]);
$result['auth_group_name'] = empty($auth_group_name) ? '':$auth_group_name;
$auth_group = $m_auth_group->getAuthGroup($result['auth_group_id'], 'title,rules');
$result['auth_group_name'] = empty($auth_group['title']) ? '':$auth_group['title'];
$m_rule = new AuthRule();
$id = $m_rule->getAuthRuleByName('index/dailyDetailsFinance', 'id');
$rules_arr = explode(',', $auth_group['rules']);
$result['show_daily'] = 0;
if (in_array($id, $rules_arr)) {
$result['show_daily'] = 1; //财务日报显示
}
}
return $result;
}
......
......@@ -231,6 +231,12 @@ class OrderLogService
break;
case 70:
break;
case 71:
break;
case 72:
break;
case 73:
break;
default:
return false;
}
......@@ -851,7 +857,8 @@ class OrderLogService
//报备
foreach ($reportData as $k => $v) {
$v["step_name"] = "report";
$house_title = mb_substr($v['house_title'], 0, 3, 'utf-8') . "***";
//$house_title = mb_substr($v['house_title'], 0, 3, 'utf-8') . "***";
$house_title = $v['house_title'];
$v["step"] = "报备【id:" . $v['house_id'] . " " . $house_title . "】";
$result[$sort++] = $v;
......@@ -873,7 +880,8 @@ class OrderLogService
if (count($marchInData) > 0) {
foreach ($marchInData as $k => $v) {
$v["step_name"] = "march_in";
$house_title = mb_substr($v['house_title'], 0, 3, 'utf-8') . "***";
//$house_title = mb_substr($v['house_title'], 0, 3, 'utf-8') . "***";
$house_title = $v['house_title'];
$v["step"] = "进场【id:" . $v['house_id'] . " " . $house_title . "】";
$result[$sort++] = $v;
}
......@@ -902,7 +910,8 @@ class OrderLogService
if (count($payLogData) > 0) {
foreach ($payLogData as $k => $v) {
$v["step_name"] = "pay_log";
$house_title = mb_substr($v['house_title'], 0, 3, 'utf-8') . "***";
//$house_title = mb_substr($v['house_title'], 0, 3, 'utf-8') . "***";
$house_title = $v['house_title'];
$v["step"] = "收款【id:" . $v['house_id'] . " " . $house_title . "】";
$result[$sort++] = $v;
}
......@@ -916,7 +925,8 @@ class OrderLogService
if (count($refundData) > 0) {
foreach ($refundData as $k => $v) {
$v["step_name"] = "refund";
$house_title = mb_substr($v['house_title'], 0, 3, 'utf-8') . "***";
//$house_title = mb_substr($v['house_title'], 0, 3, 'utf-8') . "***";
$house_title = $v['house_title'];
$v["step"] = "退款【id:" . $v['house_id'] . " " . $house_title . "】";
$result[$sort++] = $v;
}
......@@ -928,7 +938,8 @@ class OrderLogService
if (count($bargainData) > 0) {
foreach ($bargainData as $k => $v) {
$v["step_name"] = "bargain";
$house_title = mb_substr($v['house_title'], 0, 3, 'utf-8') . "***";
//$house_title = mb_substr($v['house_title'], 0, 3, 'utf-8') . "***";
$house_title = $v['house_title'];
$v["step"] = "成交报告【id:" . $v['house_id'] . " " . $house_title . "】";
$result[$sort++] = $v;
}
......@@ -986,7 +997,8 @@ class OrderLogService
//报备
foreach ($reportData as $k => $v) {
$v["step_name"] = "report";
$house_title = mb_substr($v['house_title'], 0, 3, 'utf-8') . "***";
//$house_title = mb_substr($v['house_title'], 0, 3, 'utf-8') . "***";
$house_title = $v['house_title'];
$v["step"] = "报备【id:" . $v['house_id'] . " " . $house_title . "】";
$result[$sort++] = $v;
......@@ -1009,7 +1021,8 @@ class OrderLogService
if (count($marchInData) > 0) {
foreach ($marchInData as $k => $v) {
$v["step_name"] = "march_in";
$house_title = mb_substr($v['house_title'], 0, 3, 'utf-8') . "***";
//$house_title = mb_substr($v['house_title'], 0, 3, 'utf-8') . "***";
$house_title = $v['house_title'];
$v["step"] = "进场【id:" . $v['house_id'] . " " . $house_title . "】";
$result[$sort++] = $v;
}
......@@ -1038,7 +1051,8 @@ class OrderLogService
if (count($payLogData) > 0) {
foreach ($payLogData as $k => $v) {
$v["step_name"] = "pay_log";
$house_title = mb_substr($v['house_title'], 0, 3, 'utf-8') . "***";
//$house_title = mb_substr($v['house_title'], 0, 3, 'utf-8') . "***";
$house_title = $v['house_title'];
$v["step"] = "收款【id:" . $v['house_id'] . " " . $house_title . "】";
$result[$sort++] = $v;
}
......@@ -1052,7 +1066,8 @@ class OrderLogService
if (count($refundData) > 0) {
foreach ($refundData as $k => $v) {
$v["step_name"] = "refund";
$house_title = mb_substr($v['house_title'], 0, 3, 'utf-8') . "***";
//$house_title = mb_substr($v['house_title'], 0, 3, 'utf-8') . "***";
$house_title = $v['house_title'];
$v["step"] = "退款【id:" . $v['house_id'] . " " . $house_title . "】";
$result[$sort++] = $v;
}
......@@ -1064,7 +1079,8 @@ class OrderLogService
if (count($bargainData) > 0) {
foreach ($bargainData as $k => $v) {
$v["step_name"] = "bargain";
$house_title = mb_substr($v['house_title'], 0, 3, 'utf-8') . "***";
//$house_title = mb_substr($v['house_title'], 0, 3, 'utf-8') . "***";
$house_title = $v['house_title'];
$v["step"] = "成交报告【id:" . $v['house_id'] . " " . $house_title . "】";
$result[$sort++] = $v;
}
......
......@@ -7,9 +7,11 @@ use app\model\ASuperviseModel;
use app\model\GHouses;
use app\model\GHousesFollowUp;
use app\model\GHousesImgs;
use app\model\GHousesToAgents;
use app\model\OBargainModel;
use app\model\OMarchInModel;
use app\model\OPayLogModel;
use app\model\ORefundModel;
use app\model\OReportModel;
use app\model\TAgentTotalModel;
use app\model\UPhoneFollowUp;
......@@ -894,5 +896,54 @@ class PerformanceService
return [ "code" => 200, "date" => $list ];
}
/**
* @param $bargain_id
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function collectionList($bargain_id){
$paylogModel = new OPayLogModel();
$orderParams["bargain_id"] = $bargain_id;
$field_pay_log = "a.id,a.report_id,a.create_time,a.bargain_id,a.money,a.type,a.income_time,a.source,c.id as agent_id,c.name,d.store_name,b.house_id";
$list = $paylogModel->getPayLogByOrderId($field_pay_log,$orderParams);
$reportModel = new OReportModel();
$gModel = new GHousesToAgents();
$refundModel = new ORefundModel();
$field_report = "c.name";
foreach ($list as $key=>$item){
//查询是否被退款
$refundParam["pay_log_id"] = $item["id"];
$refundResult = $refundModel->selectRefundByOrderNo("id" , $refundParam);
$list[$key]["is_refund"] = 0;
if( count($refundResult) > 0){
$list[$key]["is_refund"] = 1;
}
$list[$key]["salesman"] = "";
if($item["type"] == 91){
$params["id"] = $item["report_id"];
$result = $reportModel->getReport($field_report,$params);
$list[$key]["salesman"] = $result[0]["name"];
}
if($item["type"] == 92){
$param["a.houses_id"] = $item["house_id"];
$param["a.type"] = 3;
$param["a.is_del"] = 0;
$exclusive = $gModel->getAgentsHouses( "a.houses_id,b.name", $param);
if(empty($exclusive)){
$param["type"] = 1;
$param["is_del"] = 0;
$data = $gModel->getAgentsHouses( "a.houses_id,b.name", $param);
$list[$key]["salesman"] = $data[0]["name"];
}else{
$list[$key]["salesman"] = $exclusive[0]["name"];
}
}
}
return $list;
}
}
\ No newline at end of file
......@@ -112,7 +112,7 @@ class ReportService
// $agentArr = $vModel->getAgentsByAgentId($params["report_agent_id"]);
$params["agent_id_s"] = array( "in", $params["report_agent_id"] );
$caseHouseId = $vModel->getCaseHouseIdByAgentId($params["agent_id_s"]);
$caseHouseId = $vModel->getPanpartyAndExclusiveHouseIdByAgentId($params["agent_id_s"]);
$ids = "";
if (count($caseHouseId) > 0) {
foreach ($caseHouseId as $item) {
......@@ -184,9 +184,36 @@ class ReportService
* @throws \think\db\exception\BindParamException
* @throws \think\exception\PDOException
*/
public function orderListAll($field, $params, $pageNo, $pageSize)
public function orderListAll($field, $params, $pageNo, $pageSize,$check_type)
{
$result = $this->oReportModel->selectReportListAll($field, $params, $pageNo, $pageSize);
$vModel = new VerifyService();
$result = [];
switch ($check_type) {
case 1 :
$result = $this->oReportModel->selectReportListAll($field, $params, $pageNo, $pageSize);
break;
case 2 :
case 3 :
$agentArr = $vModel->getAgentsByAgentIdAndType($params["report_agent_id"], $check_type);
$params["agent_id_s"] = array( "in", $agentArr);
$params["report_agent_id"] = $agentArr;
$caseHouseId = $vModel->getPanpartyAndExclusiveHouseIdByAgentId($params["agent_id_s"]);
$ids = "";
if (count($caseHouseId) > 0) {
foreach ($caseHouseId as $item) {
$ids .= $item["houses_id"] . ",";
}
}
$ids = rtrim($ids, ",");
$ids = $ids ? $ids : 0;
$params["house_ids"] = $ids;
$result = $this->oReportModel->selectReportList($field, $params, $pageNo, $pageSize);
break;
default:
}
return $this->returnResult($result);
}
......@@ -336,4 +363,26 @@ class ReportService
return $param;
}
/**
* 获取权限
* @param $agent_id
* @return int
*/
public function getCheckType($agent_id)
{
$vip = new VipService();
if($vip->vip($agent_id, 'index/inspectionRecordAll/3') == 0){//代表公司
return 1;
}
if($vip->vip($agent_id, 'index/inspectionRecordDistrict/2') == 0){//代表部门
return 2;
}
if($vip->vip($agent_id, 'index/inspectionRecordStore/1') == 0){//代表门店
return 3;
}
return 0;
}
}
\ No newline at end of file
......@@ -56,7 +56,13 @@ class UploadFileService
switch ($type) {
case 'chat':
$path .= 'static/chat_image/';
$internet_path = CHAT_IMG_URL;
if (CURRENT_URL == 'https://api.tonglianjituan.com/') {
$internet_path = CHAT_IMG_URL;
} elseif (CURRENT_URL == 'https://pre2.tonglianjituan.com/') {
$internet_path = 'https://pre2.tonglianjituan.com/static/chat_image/';
} else {
$internet_path = CURRENT_URL . 'static/chat_image/';
}
break;
case 'user_header' :
$path .= 'static/user_header/';
......
......@@ -59,6 +59,35 @@ class VerifyService
return null;
}
public function getAgentsByAgentIdAndType($agent_id,$type)
{
$params["id"] = $agent_id;
$result = $this->agentModel->searchAgentsByKeyword("id,store_id,district_id,level", $params);
if (count($result) > 0) {
$arr_list = [];
switch ($type) {
case 2:
$arr_list = $this->agentModel->searchAgentsByKeyword("id", ["district_id" => $result[0]["district_id"]]);
break;
case 3:
$arr_list = $this->agentModel->searchAgentsByKeyword("id", ["store_id" => $result[0]["store_id"]]);
break;
default:
return $agent_id;
break;
}
$ids = "";
if (count($arr_list) > 0) {
foreach ($arr_list as $item) {
$ids .= $item["id"] . ",";
}
}
$ids = rtrim($ids, ",");
return $ids;
}
return null;
}
/**
* 经纪人身份验证 获取经纪人
......@@ -196,6 +225,27 @@ class VerifyService
}
/**
* 获取我的盘方和独家
* @param $agent_id
* @return false|null|\PDOStatement|string|\think\Collection
*/
public function getPanpartyAndExclusiveHouseIdByAgentId($agent_id)
{
$houseToAgentModel = new GHousesToAgents();
$params["a.agents_id"] = $agent_id;
$params["a.type"] = array("in",'2,3'); //盘方和独家
$params["a.is_del"] = 0;
$house_arr = $houseToAgentModel->getHouseByAgentId("a.houses_id,b.internal_title", $params);
if (count($house_arr) > 0) {
return $house_arr;
}
return null;
}
/**
* 获取我的盘方 楼盘
* @param $agent_id
......
......@@ -5,6 +5,7 @@ namespace app\api_broker\service;
use app\model\AAgents;
use app\model\AuthGroup;
use app\model\AuthRule;
use think\Exception;
/**
* Created by PhpStorm.
......@@ -14,6 +15,16 @@ use app\model\AuthRule;
*/
class VipService
{
private $agentModel;
private $groupModel;
private $rulesModel;
public function __construct()
{
$this->agentModel = new AAgents();
$this->groupModel = new AuthGroup();
$this->rulesModel = new AuthRule();
}
/**
* 是否具有查看vip客户权限
*
......@@ -24,20 +35,20 @@ class VipService
public function vip($id, $name = 'auth_vip')
{
//$id= 5743;
$agent = new AAgents();
$fields = 'auth_group_id';
$auth_group_id = $agent->getAgentsById($id, $fields);
if ($id == 1) {
return 0;
}
$auth_group = New AuthGroup();
$fields = 'auth_group_id';
$auth_group_id = $this->agentModel->getAgentsById($id, $fields);
$fields = 'rules';
$rules = $auth_group->getAuthGroupById($auth_group_id, $fields);
$rules = $this->groupModel->getAuthGroupById($auth_group_id, $fields);
$auth_group = New AuthRule();
$fields = 'id';
$auth_rule_id = $auth_group->getAuthRuleByName($name, $fields);
$auth_rule_id = $this->rulesModel->getAuthRuleByName($name, $fields);
$rules_arr = explode(',', $rules);
if (in_array($auth_rule_id, $rules_arr) || $id == 1) {
if (in_array($auth_rule_id, $rules_arr)) {
return 0;
} else {
return 1;
......@@ -55,9 +66,9 @@ class VipService
if (!$agent_id or !$group_id) {
return false;
}
$agent = new AAgents();
$fields = 'auth_group_id';
$auth_group_id = $agent->getAgentsById($agent_id, $fields);
$auth_group_id = $this->agentModel->getAgentsById($agent_id, $fields);
$rules_arr = explode(',', $group_id);
if (in_array($auth_group_id, $rules_arr)) {
return true;
......@@ -65,4 +76,34 @@ class VipService
return false;
}
}
/**
* 是否具有权限
*
* @param int $id
* @param string $name
* @return int 是否可以查看 0:可查看 1:不可查看
*/
public function checkRule(int $id,string $name)
{
if ($id == 1) {
return 0;
}
try {
$auth_group_id = $this->agentModel->getAgentsById($id, 'auth_group_id');
$rules = $this->groupModel->getAuthGroupById($auth_group_id, 'rules');
$auth_rule_id = $this->rulesModel->getAuthRuleByName($name, 'id');
} catch (Exception $e) {
return -1;
}
$rules_arr = explode(',', $rules);
$result = 1;
if (in_array($auth_rule_id, $rules_arr)) {
$result = 0;
}
return $result;
}
}
\ No newline at end of file
......@@ -22,6 +22,7 @@ class PerformanceValidate extends Validate
'push_id' => 'require',
'is_forbidden' => 'require|in:0,1',
'operator_id' => 'require|number',
'bargain_id' => 'require|number',
];
protected $message = [
......@@ -39,6 +40,8 @@ class PerformanceValidate extends Validate
'is_forbidden.in' => '是否绑定字段值只能为0或1',
'operator_id.require' => '操作人为必填字段',
'operator_id.number' => '操作人编号只能为数字',
'bargain_id.require' => '成交报告编号为必填字段',
'bargain_id.number' => '成交报告编号只能为数字',
];
protected $scene = [
......@@ -47,5 +50,6 @@ class PerformanceValidate extends Validate
'login' => [ 'phone', 'pwd', 'device_id', "push_id" ],
'verifyStatus' => [ 'agent_id', 'device_id' ],
'verifyIsForbidden' => [ 'phone', 'device_id', 'is_forbidden', 'operator_id' ],
'verifyCollectionList' => ['bargain_id'],
];
}
\ No newline at end of file
......@@ -609,23 +609,29 @@ class AppChat extends Basic
{
$params = $this->params;
/* $params = array(
"agent_id" => 5775
"agent_id" => 5775,
"user_id" => 123,
);*/
if (empty($params['agent_id'])) {
if (empty($params['agent_id']) && empty($params['user_id'])) {
return $this->response("101", "请求参数错误");
}
//todo 先获取是否有店铺或客户修改消息是否为0,大于0返回true,否则查询聊天消息是否有未读
$param["addressee_id"] = $params["agent_id"];
$param["is_read"] = 0;
//TODO 获取未读个数
$msgModel = new MPushMessage();
$param["type"] = array("in", "1,2,3,8");
$shop_count = $msgModel->getListCountByWhere($param);
if ($shop_count > 0) {
return $this->response("200", "success", ["is_show_red" => true]);
if (!empty($params['agent_id'])){
$param["addressee_id"] = $params["agent_id"];
$param["is_read"] = 0;
//TODO 获取未读个数
$msgModel = new MPushMessage();
$param["type"] = array("in", "1,2,3,8");
$shop_count = $msgModel->getListCountByWhere($param);
if ($shop_count > 0) {
return $this->response("200", "success", ["is_show_red" => true]);
}
$where["to_id"] = "agent_" . $params["agent_id"];
}else{
$where["to_id"] = "user_" . $params["user_id"];
}
$where["to_id"] = "agent_" . $params["agent_id"];
$where["is_read"] = 0;
$chatModel = new ChatMsg();
$msg_count = $chatModel->getTotalByToId($where);
......
......@@ -26,6 +26,8 @@ define('WEEK_WORK_IMG', IMAGES_URL . 'static'. DS . 'week_work_img/'); //周报
define('PHONE_VOICE', ROOT_PATH.'public'.DS.'static'.DS.'voice'); //录音绝对路径
define('SHOP_IMAGE_DEPOT_URL', IMAGES_URL . 'static'. DS . 'shop_image_depot/'); //C端商铺随机图片地址
define('SMS_TEMPLATE_URL', 'https://dwz.cn/fUipTngy'); //进场对客户短信提醒变量短连接
return [
// +----------------------------------------------------------------------
// | 应用设置
......
......@@ -438,7 +438,7 @@ class Auth extends Basic
$where_rule['is_menu'] = 1;
//超级管理员
$auth = new AuthRule();
$nav = $auth->getRule('',$where_rule);
$nav = $auth->getRule('',$where_rule, 'sort ASC');
$menu_data = [];
......
......@@ -20,6 +20,7 @@ use app\model\AAgentsBlackListImg;
use app\model\ABindingDevice;
use app\model\AOperatingRecords;
use app\model\AStore;
use app\model\AuthGroupSite;
use app\model\Evaluate;
use app\model\GHousesToAgents;
use app\model\GOperatingRecords;
......@@ -110,8 +111,12 @@ class Broker extends Basic
$where['district_id'] = $this->params['district_id'];
}
if ($this->params['site_id'] && ($this->userId != 1)) {
$where['site_id'] = $this->params['site_id'];
if ($this->userId != 1) {
$group_site = new AuthGroupSite();
$agent_model = new AAgents();
$auth_group_id = $agent_model->getAgentFieldById($this->userId, 'auth_group_id');
$site_id = $group_site->getAgentField('site_id', ['group_id'=>$auth_group_id]);
$where['site_id'] = ['in', $site_id];
}
if ($this->params['position'] == -1) {
......
......@@ -78,26 +78,20 @@ class DailyPaper extends Basic
"private_bank" => "55",//3000账号
"cash" => "666",//现金
"pos" => "777",//pos机
"other_bank" => "888"//其他
"other_bank" => "888",//其他
"bank_card_yun" => "2323",
"bank_card_lin"=>"1213",
"bank_card_new"=>"123123"
);*/
if ($this->siteId == 10003) {
if (empty($params["agent_id"]) || empty($params["agent_name"]) || empty($params["daily_date"]) ||
!isset($params["alipay"]) || !isset($params["tenpay"]) || !isset($params['bank_card'])
) {
return $this->response("101", "请求参数错误");
}
} else {
if (empty($params["agent_id"]) || empty($params["agent_name"]) || empty($params["daily_date"]) ||
!isset($params["alipay"]) || !isset($params["tenpay"]) || !isset($params["realty_pay"]) ||
!isset($params["family_pay"]) || !isset($params["private_bank"]) || !isset($params["cash"]) ||
!isset($params["pos"]) || !isset($params["other_bank"])
) {
return $this->response("101", "请求参数错误");
}
if (empty($params["agent_id"]) || empty($params["agent_name"]) || empty($params["daily_date"]) ||
!isset($params["alipay"]) || !isset($params["tenpay"]) || !isset($params["realty_pay"]) ||
!isset($params["family_pay"]) || !isset($params["private_bank"]) || !isset($params["cash"]) ||
!isset($params["pos"]) || !isset($params["other_bank"])
// || !isset($params["bank_card_yun"]) || !isset($params["bank_card_lin"]) || !isset($params["bank_card_new"])
) {
return $this->response("101", "请求参数错误");
}
$agent_id = $params["agent_id"];
$agent_name = $params["agent_name"];
$daily_date = $params["daily_date"];
......@@ -112,9 +106,13 @@ class DailyPaper extends Basic
$pos = $params["pos"];
$other_bank = $params["other_bank"];
$bank_card = $params["bank_card"];
$bank_card_yun = $params["bank_card_yun"] ? $params["bank_card_yun"] : 0;
$bank_card_lin = $params["bank_card_lin"] ? $params["bank_card_lin"] : 0;
$bank_card_new = $params["bank_card_new"] ? $params["bank_card_new"] : 0;
$site_id = $this->siteId;
$result = $this->service_->addDaily($agent_id, $agent_name, $daily_date, $alipay, $tenpay, $realty_pay,
$family_pay,$private_bank ,$cash, $pos, $other_bank, $tenpay_2, $alipay_2, $site_id, $bank_card);
$family_pay,$private_bank ,$cash, $pos, $other_bank, $tenpay_2, $alipay_2, $site_id, $bank_card,$bank_card_yun
,$bank_card_lin,$bank_card_new);
if ($result["code"] == 101) {
return $this->response("101", $result["msg"]);
} else {
......@@ -146,35 +144,23 @@ class DailyPaper extends Basic
"other_bank" => "888",//其他,
"operation_status" => 1,//0审核通过 1转为已审核
"remark" => "888"//备注,
"bank_card_yun" => "2323",
"bank_card_lin"=>"1213",
"bank_card_new"=>"123123"
);*/
// if (!isset($params["daily_id"]) || empty($params["agent_id"]) || empty($params["agent_name"]) ||
// !isset($params["alipay"]) || !isset($params["tenpay"]) || !isset($params["realty_pay"]) ||
// !isset($params["family_pay"]) || !isset($params["private_bank"]) || !isset($params["cash"]) ||
// !isset($params["pos"]) || !isset($params["other_bank"]) || !isset($params["operation_status"])
// ) {
// return $this->response("101", "请求参数错误");
// }
$m_daily = new ODaily();
$daily_data = $m_daily->getDailyList('id,site_id',['id'=>$params['daily_id']],1,1);
if (empty($daily_data)) {
return $this->response(101, '没有该记录,审核失败');
}
if ($daily_data[0]['site_id'] == 10003) {
if (empty($params["agent_id"]) || empty($params["agent_name"]) || empty($params["daily_id"]) ||
!isset($params["alipay"]) || !isset($params["tenpay"]) || !isset($params['bank_card']) || !isset($params["operation_status"])
) {
return $this->response("101", "请求参数错误");
}
} else {
if (!isset($params["daily_id"]) || empty($params["agent_id"]) || empty($params["agent_name"]) ||
!isset($params["alipay"]) || !isset($params["tenpay"]) || !isset($params["realty_pay"]) ||
!isset($params["family_pay"]) || !isset($params["private_bank"]) || !isset($params["cash"]) ||
!isset($params["pos"]) || !isset($params["other_bank"]) || !isset($params["operation_status"])
) {
return $this->response("101", "请求参数错误");
}
if (!isset($params["daily_id"]) || empty($params["agent_id"]) || empty($params["agent_name"]) ||
!isset($params["alipay"]) || !isset($params["tenpay"]) || !isset($params["realty_pay"]) ||
!isset($params["family_pay"]) || !isset($params["private_bank"]) || !isset($params["cash"]) ||
!isset($params["pos"]) || !isset($params["other_bank"]) || !isset($params["operation_status"])
//|| !isset($params["bank_card_yun"]) || !isset($params["bank_card_lin"]) || !isset($params["bank_card_new"])
) {
return $this->response("101", "请求参数错误");
}
$daily_id = $params["daily_id"];
......@@ -193,11 +179,15 @@ class DailyPaper extends Basic
$tenpay_2 = $params["tenpay_2"];
$alipay_2 = $params["alipay_2"];
$bank_card = $params["bank_card"];
$bank_card_yun = $params["bank_card_yun"] ? $params["bank_card_yun"] : 0;
$bank_card_lin = $params["bank_card_lin"] ? $params["bank_card_lin"] : 0;
$bank_card_new = $params["bank_card_new"] ? $params["bank_card_new"] : 0;
if($operation_status != 0 && $operation_status != 1){
return $this->response("101", "审核状态错误");
}
$result = $this->service_->addDailyCheck($daily_id,$agent_id, $agent_name, $alipay, $tenpay, $realty_pay,
$family_pay,$private_bank ,$cash, $pos, $other_bank,$remark,$operation_status, $tenpay_2, $alipay_2, $bank_card);
$family_pay,$private_bank ,$cash, $pos, $other_bank,$remark,$operation_status, $tenpay_2, $alipay_2, $bank_card,
$bank_card_yun ,$bank_card_lin,$bank_card_new);
if ($result["code"] == 101) {
return $this->response("101", $result["msg"]);
} else {
......
......@@ -9,7 +9,10 @@
namespace app\index\controller;
use app\index\extend\Basic;
use app\model\AAgents;
use app\model\ADistrict;
use app\model\AStore;
class District extends Basic
{
protected $code = 200;
......@@ -30,7 +33,6 @@ class District extends Basic
return view('index');
}
$data['status'] = 200;
$data['data'] = '';
$data['msg'] = '';
$pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo'];
$pageSize = empty($this->params['pageSize']) ? 10 : $this->params['pageSize'];
......@@ -58,7 +60,23 @@ class District extends Basic
$where['a.site_id'] = $this->params['site_id'];
}
$data['list'] = $agents->getListDistrict($pageNo, $pageSize, 'id DESC', $field, $where,$join);
$list = $agents->getListDistrict($pageNo, $pageSize, 'id DESC', $field, $where,$join);
$m_agent = new AAgents();
$m_store = new AStore();
$agent_where['level'] = ['in', '30,40'];
$status_arr = [0=>'正常',1=>'长假',2=>'离职',3=>'转勤',4=>'黑名单',5=>'冻结'];
foreach ($list as $k=>$v) {
$agent_where['district_id'] = $v['id'];
$agent_data = $m_agent->getStoreIdByAgentId('name,phone,status', $agent_where);
$agent_name = '';
foreach ($agent_data as $k2=>$v2) {
$agent_name .= $v2['name'].'-'.$v2['phone'].'('.$status_arr[$v2['status']].')-';
}
$list[$k]['name'] = rtrim($agent_name,'-');
$list[$k]['store_num'] = $m_store->getTotal(['district_id'=>$v['id'],'status'=>0]);
}
$data['list'] = $list;
$data['total'] = $agents->getListDistrictTotal($where,$join);
return $this->response($data['status'], $data['msg'], $data);
}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -2,6 +2,7 @@
namespace app\index\controller;
use app\api\untils\MessageUntils;
use app\api_broker\service\VipService;
use app\index\extend\Basic;
use app\index\service\ImageDepotService;
......@@ -9,6 +10,7 @@ use app\index\service\UserService;
use app\model\AAgents;
use app\model\GBusinessDistrict;
use app\model\GImageDepot;
use app\model\OReportModel;
use think\Cache;
use think\Log;
......@@ -179,12 +181,16 @@ class ImageDepot extends Basic
public function ceshi()
{
$arr=array('1','2','3');
$result=array_shift($arr);
dump($result);
dump($arr);
dump(count($arr));
dump(array_sum($arr));
$messageUntil = new MessageUntils();
$data = '朱伟2';
$result = $messageUntil->sendSMSForUser('18112347151',$data,'415209');
if ($result == 'true') {
return $this->response("200", "短信发送成功", $result);
} else {
return $this->response("101", $result);
}
}
......
......@@ -82,12 +82,25 @@ class Login extends Basic
return $this->response(101, '用户名或密码错误');
}
if ($user_data['status'] == 1 || $user_data['status'] == 2) {
return $this->response(101, '你目前是长假/离职状态,请联系人事进行更改');
}
if ($user_data['status']) {
switch ($user_data['status']) {
case 1 :
$msg = '您目前是长假状态,请联系人事进行更改。';break;
case 2 :
$msg = '您目前是已离职状态,请联系人事进行更改。';break;
case 3 :
$msg = '您已转勤';break;
case 4 :
$msg = '该账号已被列入黑名单!';break;
case 5 :
$msg = '该账号已被冻结!';break;
default :
$msg = '帐号异常';
}
if ($user_data['status'] == 4) {
return $this->response(101, '该账号已被列入黑名单!');
if ($msg) {
return $this->response(101, $msg);
}
}
$auth_group_id = '';
......@@ -121,11 +134,11 @@ class Login extends Basic
$where_rule['status'] = 0;
if ($user_data['id'] == 1) {
//超级管理员
$nav = $this->m_authRule->getRule('', $where_rule);
$nav = $this->m_authRule->getRule('', $where_rule, 'sort ASC');
} else {
$where_rule['id'] = [ 'in', $auth_group_id ];
//查询后台菜单
$nav = $this->m_authRule->getRule('', $where_rule);
$nav = $this->m_authRule->getRule('', $where_rule, 'sort ASC');
}
$menu_data = $auth_data = [];
......
......@@ -223,7 +223,8 @@ class PerformanceInfo extends Basic
$field .= 'District.district_name,';
$field .= 'Obargain.scale,';
$field .= 'Obargain.scale_fee,';
$field .= 'PartialCommission.practical_fee';
$field .= 'PartialCommission.practical_fee,';
$field .= 'Obargain.role';
$return = $this->oBargainModel->performancelInfoExcel($where,$field);
if(!$return){
......@@ -232,6 +233,7 @@ class PerformanceInfo extends Basic
$export = new ExportExcelUntil();
$e_data_new = [];
$role_arr = [1=>'盘方',2=>'客方',3=>'反签',4=>'独家',5=>'合作方',6=>'APP盘下载方',7=>'APP客下载方'];
foreach ($return as $key => $v) {
$e_data_old['bargain_id'] = $v["father_id"] == 0 ? $v["id"] : $v["father_id"];
......@@ -260,6 +262,7 @@ class PerformanceInfo extends Basic
$e_data_old['landmark'] = $landmark;//商铺地址
$e_data_old['house_id'] = $v['house_id'];//商铺编号
//$e_data_old['name_phone'] = $v['name'].'-'.$v['phone'];//分佣提成方
$e_data_old['role_name'] = $role_arr[$v['role']];//分佣提成方
$e_data_old['name_phone'] = $v['name'];//分佣提成方
//$e_data_old['district_name'] = $v['district_name'].'-'.$v['store_name'];//所属部门
$e_data_old['district_name'] = $v['store_name'];//所属部门
......@@ -270,7 +273,7 @@ class PerformanceInfo extends Basic
$e_data_new[]=$e_data_old;
}
$title = [ '成交报告ID', '分佣ID','提交时间', '成交类型', '商铺地址', '商铺编号', '分佣提成方', '所属部门门店', '分佣比例', '应分佣金', '实收佣金' ,'成交价'];
$title = [ '成交报告ID', '分佣ID','提交时间', '成交类型', '商铺地址', '商铺编号','角色', '分佣提成方', '所属部门门店', '分佣比例', '应分佣金', '实收佣金' ,'成交价'];
$export->exportTable('业绩明细', $e_data_new, count($e_data_new[0]), '业绩明细表', $title);
return '';
}
......
......@@ -184,8 +184,8 @@ class Remark extends Basic
if (!empty($this->params['start_date']) || !empty($this->params['end_date'])) {
$time = strtotime($this->params['end_date']) - strtotime($this->params['start_date']);
if ($time > 1296000 || $time < 0) {
return $this->response(101, '搜索时间不能大于15天');
if ($time > 2592000 || $time < 0) {
return $this->response(101, '搜索时间不能大于30天');
}
}
......
......@@ -10,6 +10,7 @@ namespace app\index\controller;
use app\index\extend\Basic;
use app\model\AAgents;
use app\model\OReportModel;
class Report extends Basic
......@@ -28,6 +29,23 @@ class Report extends Basic
$pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo'];
$pageSize = empty($this->params['pageSize']) ? 15 : $this->params['pageSize'];
$m_report = new OReportModel();
$m_agent = new AAgents();
switch ($this->params['check_status']) {
case 0 :
$where['a.report_agent_id'] = $this->userId;
break;
case 1 :
$store_id = $m_agent->getAgentFieldById($this->userId, 'store_id');
$where['d.store_id'] = $store_id;
break;
case 2 :
$district_id = $m_agent->getAgentFieldById($this->userId, 'district_id');
$where['d.district_id'] = $district_id;
break;
case 3 :
break;
}
$data['code'] = 200;
$data['msg'] = "";
$where["a.status"] = 0;
......@@ -63,7 +81,7 @@ class Report extends Basic
$where['b.id'] = $this->params['order_id'];
}
$field = 'b.id as order_id,a.user_name,a.user_phone,a.create_time,a.report_agent_name,c.internal_title,a.predict_see_time';
$field = 'b.id as order_id,a.user_name,a.user_phone,a.create_time,a.report_agent_name,c.internal_title as house_title,a.predict_see_time';
$field .= ',a.id,b.order_no';
try {
......
......@@ -168,6 +168,7 @@ class Setting extends Basic
$redis->set('s_lookNum', $agent_shop_num); //业务员最多可查看的商铺数量
$redis->set('s_agent_call_day', $data['agent_call_day']); //业务员多少天可以打多少电话
$redis->set('s_agent_call_number', $data['agent_call_number']); //业务员多少天可以打多少电话
$redis->set('s_agent_suspend', $data['agent_suspend']); //业务员多少天可以打多少电话
return ;
}
......
......@@ -79,6 +79,7 @@ class Basic extends Controller
'index/userModalList',
'index/mainIndex',
'index/uploadImg',
'index/uploadEditor'
'index/uploadEditor',
'index/downloadFile'
);
......
......@@ -19,6 +19,7 @@ use app\model\ADistrict;
use app\model\AOperatingRecords;
use app\model\ASite;
use app\model\AuthGroupSite;
use app\model\Evaluate;
use app\model\GHousesToAgents;
use app\model\GOperatingRecords;
use app\model\OMarchInModel;
......@@ -52,8 +53,10 @@ class BrokerService
$select_where['name'] = $data['name'];
$select_where['site_id'] = $data['site_id'];
if (empty($data['id'])) {
$select_where['status'] = 0;
$select_where['phone'] = ['<>', $data['phone']];
} else {
$select_where['status'] = 0;
$select_where['id'] = ['<>', $data['id']];
}
$check_id = $this->m_agent->getAgentsByWhere($select_where, 'id');
......@@ -341,20 +344,24 @@ class BrokerService
unset($data['id']);
$data['password_md5'] = $agent_old[0]['password'];
$data['img'] = $agent_old[0]['img'];
$id = $this->m_agent->saveAgent($data); //普通转勤
$this->transferUserHouse($id, $agent_old[0]['id'], $operation_id, $data);
$this->transferEvaluate($id, $agent_old[0]['id']);
} else {
$agent_old[0]['status'] = 3;
unset($agent_old[0]['id']);
$this->m_agent->saveAgent($agent_old[0]); //新增一条转勤状态
$data['id'] = $agent_old[0]['id']; //将原来的id作为新的
$data['img'] = $agent_old[0]['img'];
$id = $this->m_agent->saveAgent($data);
}
} else {
$this->m_agent->saveAgent(['id'=>$agent_old[0]['id'], 'status'=>3]); //将原来的设置为转勤状态
$this->m_agent->saveAgent(['id'=>$transfer_agent, 'status'=>0]); //将原来转勤状态处理为正常
$this->m_agent->saveAgent(['id'=>$transfer_agent, 'status'=>0, 'img'=>$agent_old[0]['img']]); //将原来转勤状态处理为正常
$this->transferUserHouse($transfer_agent, $agent_old[0]['id'], $operation_id, $data);
$this->transferEvaluate($transfer_agent, $agent_old[0]['id']);
$id = $transfer_agent;
}
......@@ -383,17 +390,26 @@ class BrokerService
$m_user = new Users();
$update_user = $update_house = [];
$user_id_arr = $m_user->getUserByWhereColumn(['agent_id' => $change_old_id], 'id');
$referrer_id_arr = $m_user->getUserByWhereColumn(['referrer_id' => $change_old_id, 'referrer_source'=>20], 'id');
foreach ($user_id_arr as $k => $v) {
$update_user[$k]['id'] = $v;
$update_user[$k]['agent_id'] = $id;
}
$record_data['user_id'] = empty($user_id_arr) ? "" : implode(',', $user_id_arr);
foreach ($referrer_id_arr as $k2=>$v2) {
$update_referrer = [
'id'=>$v2,
'referrer_id'=>$id
];
array_push($update_user, $update_referrer);
}
$record_data['user_id'] = empty($user_id) ? "" : implode(',', $user_id);
$m_house = new GHousesToAgents();
$house_where['is_del'] = 0;
$house_where['agents_id'] = $change_old_id;
$house_where['type'] = ['in', '2,3'];
// $house_where['type'] = ['in', '2,3'];
$house_id_arr = $m_house->getAgentHouseOne('id', $house_where);
foreach ($house_id_arr as $k => $v) {
......@@ -432,7 +448,7 @@ class BrokerService
*/
private function rootDOLog($id, $status)
{
$agent_status =[0=>'正常',1=>'长假',2=>'离职',3=>'转勤'];
$agent_status =[0=>'正常',1=>'长假',2=>'离职',3=>'转勤',4=>'锁定'];
$records = new GOperatingRecords();
$remark = '修改为 '.$agent_status[$status];
$result = $records->record(0, 7, $remark, '',$id);
......@@ -454,5 +470,16 @@ class BrokerService
return true;
}
/**
* 转换评价
*
* @param $agent_id
* @param $change_old_id
* @return Evaluate
*/
public function transferEvaluate($agent_id, $change_old_id){
$m_evaluate = new Evaluate();
return $m_evaluate->updateData(['agents_id'=>$agent_id], ['agents_id'=>$change_old_id]);
}
}
\ No newline at end of file
......@@ -635,6 +635,9 @@ class UserService
$where[] = ['EXP', "(bind_id = '{$user_info['bind_id']}' or id = '{$user_info['bind_id']}') and id != '{$user_id}'"];
}
$user_info_list = $this->user->getUserByWhere($where,$field);
foreach ($user_info_list as $k=>$v) {
$user_info_list[$k]['user_phone'] = preg_replace('/(\d{3})\d{4}(\d{4})/', '$1****$2', $v["user_phone"]);
}
return $user_info_list;
}
......
......@@ -156,6 +156,8 @@
<option value="2">离职</option>
<option value="3">已转勤</option>
<option value="4">黑名单</option>
<option value="5">自动锁定</option>
</select>
<span class="btn btn-info btn3 ld-Marheight" id="search">搜索</span>
<span class="btn btn-info btn3 ld-Marheight" id="reset">重置</span>
......
......@@ -294,6 +294,7 @@
<th class="text-center">所属门店</th>
<th class="text-center">是否开业</th>
<th class="text-center">是否分红</th>
<th class="text-center">入账日期</th>
<th class="text-center">操作</th>
</tr>
</thead>
......@@ -323,6 +324,7 @@
<th class="text-center">是否开业</th>
<th class="text-center">是否分红</th>
<th class="text-center">备注</th>
<th class="text-center">入账日期</th>
<th class="text-center">操作</th>
</tr>
</thead>
......@@ -349,6 +351,7 @@
<th class="text-center">业务员</th>
<th class="text-center">所属门店</th>
<th class="text-center">意向金收条编号</th>
<th class="text-center">入账日期</th>
<th class="text-center">操作</th>
</tr>
</thead>
......@@ -374,6 +377,7 @@
<th class="text-center">业务员</th>
<th class="text-center">所属门店</th>
<th class="text-center">保管金收条编号</th>
<th class="text-center">入账日期</th>
<th class="text-center">操作</th>
</tr>
</thead>
......@@ -421,7 +425,11 @@
<th class="text-center shenzhen">筠姐支付宝</th>
<th class="text-center shenzhen">筠姐微信</th>
<th class="text-center shenzhen">银满谷银行卡</th>
<!--上海 杭州 店长 commit-->
<th class="text-center shenzhen">筠姐上海银行卡</th>
<th class="text-center shenzhen">POS机</th>
<th class="text-center shenzhen">世家公账</th>
<!--上海 店长 commit-->
<th class="text-center shanghai">施总支付宝</th>
<th class="text-center shanghai">林老师支付宝</th>
<th class="text-center shanghai">施总微信</th>
......@@ -432,6 +440,23 @@
<th class="text-center shanghai">现金</th>
<th class="text-center shanghai">POS机</th>
<th class="text-center shanghai">其他</th>
<th class="text-center shanghai">银满谷银行卡</th>
<th class="text-center shanghai">新同联福居银行卡</th>
<!--杭州 店长 commit-->
<th class="text-center hangzhou">施总支付宝</th>
<th class="text-center hangzhou">林老师支付宝</th>
<th class="text-center hangzhou">施总微信</th>
<th class="text-center hangzhou">林老师微信</th>
<th class="text-center hangzhou">地产转账</th>
<th class="text-center hangzhou">世家公账</th>
<th class="text-center hangzhou">3000账号</th>
<th class="text-center hangzhou">现金</th>
<th class="text-center hangzhou">POS机</th>
<th class="text-center hangzhou">其他</th>
<th class="text-center hangzhou">银满谷银行卡</th>
<th class="text-center hangzhou">林老师建行卡</th>
<th class="text-center">提交人</th>
<th class="text-center">提交时间</th>
......@@ -449,7 +474,17 @@
<td class="text-center shenzhen">
<span id="pay_yun_card"></span>
</td>
<!--上海 杭州 店长 commit-->
<td class="text-center shenzhen">
<span id="pay_yun_bank"></span>
</td>
<td class="text-center shenzhen">
<span id="pay_yun_pos"></span>
</td>
<td class="text-center shenzhen">
<span id="pay_yun_family"></span>
</td>
<!--上海 店长 commit-->
<td class="text-center shanghai">
<span id="pay_a"></span>
</td>
......@@ -480,6 +515,52 @@
<td class="text-center shanghai">
<span id="pay_h"></span>
</td>
<td class="text-center shanghai">
<span id="pay_k"></span>
</td>
<td class="text-center shanghai">
<span id="pay_m"></span>
</td>
<!--杭州 店长 commit-->
<td class="text-center hangzhou">
<span id="pay_a_hangzhou"></span>
</td>
<td class="text-center hangzhou">
<span id="pay_a1_hangzhou"></span>
</td>
<td class="text-center hangzhou">
<span id="pay_b_hangzhou"></span>
</td>
<td class="text-center hangzhou">
<span id="pay_b1_hangzhou"></span>
</td>
<td class="text-center hangzhou">
<span id="pay_c_hangzhou"></span>
</td>
<td class="text-center hangzhou">
<span id="pay_d_hangzhou"></span>
</td>
<td class="text-center hangzhou">
<span id="pay_e_hangzhou"></span>
</td>
<td class="text-center hangzhou">
<span id="pay_f_hangzhou"></span>
</td>
<td class="text-center hangzhou">
<span id="pay_g_hangzhou"></span>
</td>
<td class="text-center hangzhou">
<span id="pay_h_hangzhou"></span>
</td>
<td class="text-center hangzhou">
<span id="pay_k_hangzhou"></span>
</td>
<td class="text-center hangzhou">
<span id="pay_m_hangzhou"></span>
</td>
<td class="text-center">
<span id="pay_i"></span>
......@@ -504,6 +585,9 @@
<th class="text-center shenzhen">筠姐支付宝</th>
<th class="text-center shenzhen">筠姐微信</th>
<th class="text-center shenzhen">银满谷银行卡</th>
<th class="text-center shenzhen">筠姐上海银行卡</th>
<th class="text-center shenzhen">POS机</th>
<th class="text-center shenzhen">世家公账</th>
<!--上海 杭州 total 财务-->
<th class="text-center shanghai">施总支付宝</th>
<th class="text-center shanghai">林老师支付宝</th>
......@@ -515,6 +599,22 @@
<th class="text-center shanghai">现金</th>
<th class="text-center shanghai">POS机</th>
<th class="text-center shanghai">其他</th>
<th class="text-center shanghai">银满谷银行卡</th>
<th class="text-center shanghai">新同联福居银行卡</th>
<!--杭州 total 财务-->
<th class="text-center hangzhou">施总支付宝</th>
<th class="text-center hangzhou">林老师支付宝</th>
<th class="text-center hangzhou">施总微信</th>
<th class="text-center hangzhou">林老师微信</th>
<th class="text-center hangzhou">地产转账</th>
<th class="text-center hangzhou">世家公账</th>
<th class="text-center hangzhou">3000账号</th>
<th class="text-center hangzhou">现金</th>
<th class="text-center hangzhou">POS机</th>
<th class="text-center hangzhou">其他</th>
<th class="text-center hangzhou">银满谷银行卡</th>
<th class="text-center hangzhou">林老师建行卡</th>
<th class="text-center">审核人</th>
<th class="text-center">审核时间</th>
<th class="text-center">备注</th>
......@@ -526,6 +626,7 @@
</tbody>
<tfoot class="text-center" id="maintable_list_total">
<tr>
<!--深圳-->
<td class="text-center shenzhen">
<span id="total_yun_zhihubao"></span>
</td>
......@@ -535,7 +636,18 @@
<td class="text-center shenzhen">
<span id="total_yun_card"></span>
</td>
<td class="text-center shenzhen">
<span id="total_yun_bank"></span>
</td>
<td class="text-center shenzhen">
<span id="total_yun_pos"></span>
</td>
<td class="text-center shenzhen">
<span id="total_yun_family"></span>
</td>
<!--上海-->
<td class="text-center shanghai">
<span id="total_a"></span>
</td>
......@@ -566,6 +678,52 @@
<td class="text-center shanghai">
<span id="total_h"></span>
</td>
<td class="text-center shanghai">
<span id="total_m"></span>
</td>
<td class="text-center shanghai">
<span id="total_n"></span>
</td>
<!--杭州-->
<td class="text-center hangzhou">
<span id="total_a_hangzhou"></span>
</td>
<td class="text-center hangzhou">
<span id="total_a1_hangzhou"></span>
</td>
<td class="text-center hangzhou">
<span id="total_b_hangzhou"></span>
</td>
<td class="text-center hangzhou">
<span id="total_b1_hangzhou"></span>
</td>
<td class="text-center hangzhou">
<span id="total_c_hangzhou"></span>
</td>
<td class="text-center hangzhou">
<span id="total_d_hangzhou"></span>
</td>
<td class="text-center hangzhou">
<span id="total_e_hangzhou"></span>
</td>
<td class="text-center hangzhou">
<span id="total_f_hangzhou"></span>
</td>
<td class="text-center hangzhou">
<span id="total_g_hangzhou"></span>
</td>
<td class="text-center hangzhou">
<span id="total_h_hangzhou"></span>
</td>
<td class="text-center hangzhou">
<span id="total_m_hangzhou"></span>
</td>
<td class="text-center hangzhou">
<span id="total_n_hangzhou"></span>
</td>
<td class="text-center">
<span id="total_i"></span>
</td>
......@@ -882,19 +1040,30 @@
<strong><span class="col-xs-3 ld-Marheight">支付方式:</span></strong>
<div class="col-xs-6">
<select class="form-control" id="payType">
<option value="10">施总支付宝</option>
<option value="11">林老师支付宝</option>
<option value="12">筠姐支付宝</option>
<option value="20">施总微信</option>
<option value="21">林老师微信</option>
<option value="22">筠姐微信</option>
<option value="30">pos机器</option>
<option value="40">地产转账</option>
<option value="41">世家公账</option>
<option value="42">3000账号</option>
<option value="50">现金</option>
<option value="70">银满谷银行卡</option>
<option value="60">其他</option>
<option value="10" class="shanghaipayType">施总支付宝</option>
<option value="11" class="shanghaipayType">林老师支付宝</option>
<option value="20" class="shanghaipayType">施总微信</option>
<option value="21" class="shanghaipayType">林老师微信</option>
<option value="30" class="shanghaipayType">pos机器</option>
<option value="40" class="shanghaipayType">地产转账</option>
<option value="42" class="shanghaipayType">3000账号</option>
<option value="70" class="shanghaipayType">银满谷银行卡</option>
<option value="73" class="shanghaipayType">新同联福居银行卡</option>
<option value="41" class="shanghaipayType">世家公账</option>
<option value="11" class="hangzhoupayType">林老师支付宝</option>
<option value="21" class="hangzhoupayType">林老师微信</option>
<option value="30" class="hangzhoupayType">pos机器</option>
<option value="70" class="hangzhoupayType">银满谷银行卡</option>
<option value="72" class="hangzhoupayType">林老师建行卡</option>
<option value="12" class="shenzhengpayType">筠姐支付宝</option>
<option value="22" class="shenzhengpayType">筠姐微信</option>
<option value="71" class="shenzhengpayType">筠姐上海银行卡</option>
<option value="41" class="shenzhengpayType">世家公账</option>
<option value="30" class="shenzhengpayType">pos机器</option>
</select>
</div>
</div>
......
......@@ -380,8 +380,10 @@
<option value="42">3000账号</option>
<option value="50">现金</option>
<option value="70">银满谷银行卡</option>
<option value="71">筠姐上海银行卡</option>
<option value="72">林老师建行卡</option>
<option value="73">新同联福居银行卡</option>
<option value="60">其他</option>
</select>
<select class="form-control btn2 ld-Marheight" id="come_from">
......@@ -828,21 +830,24 @@
<option value="21" class="shanghai">林老师微信</option>
<option value="30" class="shanghai">pos机器</option>
<option value="40" class="shanghai">地产转账</option>
<option value="41" class="shanghai">世家公账</option>
<option value="42" class="shanghai">3000账号</option>
<option value="50" class="shanghai">现金</option>
<option value="60" class="shanghai">其他</option>
<option value="70" class="shanghai">银满谷银行卡</option>
<option value="73" class="shanghai">新同联福居银行卡</option>
<option value="41" class="shanghai">世家公账</option>
<option value="11" class="hangzhou">林老师支付宝</option>
<option value="21" class="hangzhou">林老师微信</option>
<option value="30" class="hangzhou">pos机器</option>
<option value="40" class="hangzhou">地产转账</option>
<option value="50" class="hangzhou">现金</option>
<!--<option value="60" class="hangzhou">其他</option>-->
<option value="70" class="hangzhou">银满谷银行卡</option>
<option value="72" class="hangzhou">林老师建行卡</option>
<option value="12" class="shenzheng">筠姐支付宝</option>
<option value="22" class="shenzheng">筠姐微信</option>
<option value="70" class="shenzheng">银满谷银行卡</option>
<option value="71" class="shenzheng">筠姐上海银行卡</option>
<option value="41" class="shenzheng">世家公账</option>
<option value="30" class="shenzheng">pos机器</option>
</select>
</div>
......
......@@ -290,6 +290,12 @@
<div class="">
<div class="panel panel-default">
<div class="panel-heading breadcrumb">
<div class="text-danger">
备注:一、在审核中状态时,有2个人审核通过,则单子 自动从 审核中 状态 走到 已审核 状态。即 退款只要经过了2个人审核,便审核通过。<br />
</div>
<div style="margin-left: 42px;margin-bottom: 10px;" class="text-danger">
二、出纳人员在已审核列表,点击【转到已退款】按钮,上传转账图片,进行退款转账操作,则退款单子从已审核状态 走到已退款状态。
</div>
<li>
<a href="javascript:;">退款出账</a>
</li>
......@@ -415,7 +421,7 @@
<!-- /.modal -->
</div>
<!-- 收款详情 -->
<div class="modal fade" id="modal-check" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal fade" id="modal-check" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="font-size: 16px;">
<div class="modal-dialog modal-body-width">
<div class="modal-content">
<div class="modal-header">
......
......@@ -86,6 +86,7 @@
</td>
</tr>
<tr>
<th class="text-center">带看ID</th>
<th class="text-center">客户姓名</th>
<th class="text-center">客户电话</th>
<th class="text-center">进场时间</th>
......@@ -133,6 +134,7 @@
<!--主要列表模板-->
<script id="marchin_list_tpl" type="text/template">
<tr class="text-center">
<td>{7}</td>
<td>{0}</td>
<td>{1}</td>
<td>{2}</td>
......
......@@ -6,6 +6,9 @@
<!-- /#sidebar-wrapper -->
<!-- Page Content -->
<div id="page-content-wrapper">
<div class="container">
<div class="row">
......
......@@ -210,6 +210,19 @@
<div class="col-xs-12 p-a-0" style="height:3.86rem" >
<div class="col-xs-8 p-a-10 p-t-0" >
<div class="panel panel-default">
<div style="float:right;margin-top:.1rem;margin-right : .1rem ;">
<select class="form-control" id="orderCity">
<!--<option value="0">
上海
</option>
<option value="1">
杭州
</option>
<option value="2">
深圳
</option>-->
</select>
</div>
<div class="area-title p-a-15 p-tb-10">
<span><strong>团队荣誉榜</strong><span class="time_control" id="tymd"></span></span>
</div>
......@@ -267,7 +280,7 @@
<div class="area-title p-a-15 p-b-10">
<a><span id="table-title" class="active table-choose">职称</span></a>
<a><span id="group-title" class="table-choose left-padding ">团队</span></a>
<a><span class="btn more-news-long-1" id="initOder" style="font-size:15px;">加载</span></a>
<!--<a><span class="btn more-news-long-1" id="initOder" style="font-size:15px;">加载</span></a>-->
<a><span class="title-time" id="table-time"></span></a>
</div>
......
......@@ -54,6 +54,14 @@
<table class="table table-striped table-bordered table-hover table-condensed">
<thead>
<!--同步app-->
<tr>
<td colspan="14" class="maintable-top-sub-tr">
<a class="btn btn-info liudan_pic_btn" id="our">我的</a>
<a class="btn btn-default liudan_pic_btn" id="is_show_store">门店</a>
<a class="btn btn-default liudan_pic_btn" id="is_show_district">部门</a>
<a class="btn btn-default liudan_pic_btn" id="is_show_all">全部</a>
</td>
</tr>
<tr>
<td colspan="10">
<form id="form_search">
......
......@@ -386,6 +386,21 @@ class AAgents extends BaseModel
->select();
}
public function selectFollowUpNumByAgent( $field = "a.id",$table,$params,$num)
{
$params["district_id"] = array( 'not in', array( '13', '14', '15' ) );
$result = Db::table($this->table)
->field($field)
->alias("a")
->join( "$table b" ,"a.id = b.agent_id","left")
->where($params)
->group("a.id")
->having("count < $num")
->select();
//echo $this->getLastSql();
return $result;
}
/**
* @param string $field
* @param $params
......@@ -1576,6 +1591,9 @@ class AAgents extends BaseModel
}
public function findByOne($field,$params) {
if (!isset($params['status'])) {
$where['status'] = 0;
}
$result = $this
->field($field)
->where($params)
......@@ -1600,6 +1618,36 @@ class AAgents extends BaseModel
->count();
//dump($this->getLastSql());
return $return;
} /**
* @param $field
* @param $where
* @return array|false|\PDOStatement|string|\think\Model
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getAgentUser($field, $where) {
return $this->alias('a')
->field($field)
->join('u_users b','a.id = b.agent_id', 'left')
->where($where)
->find();
}
/**
* @param $field
* @param $where
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getAgentHouseType($field, $where) {
return $this->alias('a')
->field($field)
->join('g_houses_to_agents b', 'a.id=b.agents_id', 'left')
->where($where)
->find();
}
}
\ No newline at end of file
......@@ -116,7 +116,6 @@ class ADistrict extends BaseModel
$data['city'] = Db::table('a_site')->where('id', $district['site_id'])->value('city');
$agents = Db::table('a_agents')->field('name,phone')
->where([
'status' => 0,
'level' => ['in',[30,40]],
'district_id' => $id
])->find();
......@@ -153,30 +152,6 @@ class ADistrict extends BaseModel
->limit($pageSize)
->page($pageNo)
->select();
$result = array();
foreach ($data as $k=>$v){
$result[$k] = $v;
if (isset($v->id)) {
if ($result[$k]['district_name']) {
$agents = Db::table('a_agents')->field('name,phone')->where([
'status'=>0,'district_id'=>$v->id,'level'=>['in','30,40']
])->find();
$result[$k]['name'] = $agents['name'].'-'.$agents['phone'];
$result[$k]['store_num'] = Db::table('a_store')->where([
'status'=>0,'district_id'=>$v->id
])->count('store_name');
} else {
$result[$k]['store_num'] = '';
}
}
if ($v['site_id']) {
$result[$k]['city'] = Db::table('a_site')->where('id', $v['site_id'])->value('city');
} else {
$result[$k]['city'] = "";
}
}
} else {
$data = $this->field($field)->alias('a')
->join('a_agents b','a.id=b.district_id','left')
......@@ -185,30 +160,9 @@ class ADistrict extends BaseModel
->limit($pageSize)
->page($pageNo)
->select();
$result = array();
foreach ($data as $k=>$v){
$result[$k] = $v;
if (isset($v->id)) {
if ($result[$k]['district_name']) {
$result[$k]['name'] = $v['name'].'-'.$v['phone'];
$result[$k]['store_num'] = Db::table('a_store')->where([
'status'=>0,'district_id'=>$v->id
])->count('store_name');
} else {
$result[$k]['store_num'] = '';
}
}
if ($v['site_id']) {
$result[$k]['city'] = Db::table('a_site')->where('id', $v['site_id'])->value('city');
} else {
$result[$k]['city'] = "";
}
}
}
return $result;
return $data;
}
/**
......
......@@ -79,4 +79,20 @@ class AuthGroup extends BaseModel
->where('status', $status)
->value($fields);
}
/**
* @param $id
* @param $fields
* @param int $status
* @return array|false|\PDOStatement|string|\think\Model
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getAuthGroup($id, $fields, $status = 0)
{
return $this->field($fields)->where('id',$id)
->where('status', $status)
->find();
}
}
......@@ -69,4 +69,14 @@ class AuthGroupSite extends BaseModel
return $data;
}
/**
* @param $id
* @param $fields
* @return mixed
*/
public function getAgentField($fields, $where)
{
return $this->where($where)->value($fields);
}
}
\ No newline at end of file
......@@ -170,15 +170,16 @@ class AuthRule extends BaseModel
*
* @param string $field
* @param $where
* @param string $order
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getRule($field = 'id,name,title,pid,is_menu', $where) {
public function getRule($field = 'id,name,title,pid,is_menu', $where, $order = 'sort ASC') {
return $this->field($field)
->where($where)
->order('sort ASC')
->order($order)
->select();
}
......
......@@ -17,11 +17,12 @@ class BaseModel extends Model
* 记录总数
*
* @param $params
* @param string $field
* @return int|string
*/
public function getTotal($params)
public function getTotal($params,$field = 'id')
{
return $this->where($params)->count();
return $this->where($params)->count($field);
}
/**
......
......@@ -111,6 +111,7 @@ class Evaluate extends Model
$params["user_id"] = $userId;
return $this->field("id")
->where($params)
->group("type")
->select();
}
......@@ -192,4 +193,13 @@ class Evaluate extends Model
//dump($this->getLastSql());
return $result;
}
/**
* @param $data
* @param $where
* @return Evaluate
*/
public function updateData($data, $where) {
return $this->where($where)->update($data);
}
}
......@@ -266,6 +266,27 @@ class GHousesToAgents extends BaseModel
return $result;
}
/**
* @param string $field
* @param string $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getAgentsHouses( $field = '', $params = '')
{
$data = $this->field($field)
->alias('a')
->join('a_agents b', 'a.agents_id = b.id', 'left')
->where($params)
->select();
// echo $this->getLastSql();
return $data;
}
/**
* @param $field
* @param $params
......@@ -425,7 +446,7 @@ class GHousesToAgents extends BaseModel
* @param array $where
* @return array
*/
public function getHouseAgent(string $field = '', array $where = []) : array
public function getHouseAgent(string $field = "", array $where = []) : array
{
try {
$where['a.is_del'] = 0;
......
......@@ -138,6 +138,9 @@ class OPayLogModel extends Model
if (isset($params["house_title"])) {
$where_["b.house_title"] = $params["house_title"];
}
if (isset($params["bargain_id"])) {
$where_["a.bargain_id"] = $params["bargain_id"];
}
$where_["a.is_del"] = 0;
return Db::table($this->table)
->field($field)
......@@ -149,6 +152,7 @@ class OPayLogModel extends Model
->select();
}
/**
* @param $params
* @return false|\PDOStatement|string|\think\Collection
......
......@@ -92,6 +92,9 @@ class ORefundModel extends Model{
if (isset($params["status"])) {
$where_["status"] = $params["status"];
}
if (isset($params["pay_log_id"])) {
$where_["pay_log_id"] = $params["pay_log_id"];
}
return $this->db_
->field($filed)
......
......@@ -176,6 +176,9 @@ class OReportModel extends Model
if (isset($params["user_id"])) {
$where_["a.user_id"] = $params["user_id"];
}
if (isset($params["id"])) {
$where_["a.id"] = $params["id"];
}
return $this->db->field($filed)
->alias("a")
->join("o_order b", "a.id = b.f_id", "left")
......@@ -742,6 +745,7 @@ class OReportModel extends Model
{
$result = $this->db->field($field)
->alias("a")
->join("a_agents d", "a.report_agent_id = d.id", "left")
->join("o_order b", "a.id = b.f_id", "left")
->join("g_houses c", "b.house_id = c.id", "left")
->where($params)
......@@ -761,6 +765,7 @@ class OReportModel extends Model
public function getAddReportListTotal($params)
{
return $this->db->alias("a")
->join("a_agents d", "a.report_agent_id = d.id", "left")
->join("o_order b", "a.id = b.f_id", "left")
->join("g_houses c", "b.house_id = c.id", "left")
->where($params)
......
......@@ -380,8 +380,11 @@ Route::group('index', [
//站点相关
'addSite' => ['index/Site/addSite', ['method' => 'POST|GET']], //获取站点列表 朱伟 2018-10-18
'getSiteList' => ['index/Site/getSiteList', ['method' => 'POST|GET']], //获取站点列表 朱伟 2018-10-18
'delImageDepot_Site' => ['index/Site/delImageDepot', ['method' => 'POST|GET']], //关闭或开启站点 朱伟 2018-10-18
'inspectionRecordAll' => ['index/Report/inspectionRecordAll', ['method' => 'GET']], //全部约带看
'delImageDepot_Site' => ['index/Site/delImageDepot', ['method' => 'POST|GET']], //关闭或开启站点 朱伟 2018-10-18
'inspectionRecordOur/:check_status' => ['index/Report/inspectionRecordAll', ['method' => 'GET'],['check_status'=>0]], //我的约带看
'inspectionRecordStore/:check_status' => ['index/Report/inspectionRecordAll', ['method' => 'GET'], ['check_status'=>1]], //门店约带看
'inspectionRecordDistrict/:check_status' => ['index/Report/inspectionRecordAll', ['method' => 'GET'],['check_status'=>2]], //部门约带看
'inspectionRecordAll/:check_status' => ['index/Report/inspectionRecordAll', ['method' => 'GET'],['check_status'=>3]], //全部约带看
'setSite' => ['index/auth/setSite', ['method' => 'GET|POST']], //设置角色站点
......@@ -430,6 +433,7 @@ Route::group('api', [
//get broker
'getBroker' => ['api/broker/index', ['method' => 'get']], //获取当前商铺或街铺的经纪人评论信息列表
'getBrokerV2' => ['api/broker/indexV2', ['method' => 'get']], //获取当前商铺或街铺的经纪人评论信息列表
'test' => ['api/broker/testtest', ['method' => 'get']], //获取当前商铺或街铺的经纪人评论信息列表
'commentAndDeal' => ['api/broker/commentAndDeal', ['method' => 'get']], //获取当前经纪人的评价和交易列表
'brokerDetail' => ['api/broker/brokerDetail', ['method' => 'get']], //经纪人详情
......@@ -577,6 +581,8 @@ Route::group('task', [
'test' => ['task/FollowUpTask/test', ['method' => 'get']],
'isExistTable' => ['task/FollowUpTask/isExistTable', ['method' => 'get']],
'moveFollowUpList' => ['task/FollowUpTask/moveFollowUpList', ['method' => 'get']],
'frostAgent' => ['task/FrostAgentTask/frostAgent', ['method' => 'get']],
]);
Route::group('broker', [
......@@ -639,6 +645,7 @@ Route::group('broker', [
'reportList' => ['api_broker/Report/reportList', ['method' => 'get']],
'getCheckType' => ['api_broker/Report/getCheckType', ['method' => 'get|post']],
'reportListForPc' => ['api_broker/Report/reportListForPc', ['method' => 'get']],
'orderDetail' => ['api_broker/OrderLog/orderDetail', ['method' => 'get|post']],
......@@ -709,14 +716,15 @@ Route::group('broker', [
'userFollowUpListV2' => ['api_broker/HomePageLog/userFollowUpListV2', ['method' => 'post|get']],
'houseFollowUpList' => ['api_broker/HomePageLog/houseFollowUpList', ['method' => 'post']],
'housingResource' => ['api_broker/Performance/housingResource', ['method' => 'POST|GET']], //获取房源list
'userResource' => ['api_broker/Performance/userResource', ['method' => 'POST|GET']], //获取客源list
'followList' => ['api_broker/Performance/followList', ['method' => 'POST|GET']], //报备list
'marchInList' => ['api_broker/Performance/marchInList', ['method' => 'POST|GET']], //进场list
'paylogList' => ['api_broker/Performance/paylogList', ['method' => 'POST|GET']], //收款list
'performanceList' => ['api_broker/Performance/performanceList', ['method' => 'POST|GET']], //业绩list
'superviseList' => ['api_broker/Performance/superviseList', ['method' => 'POST|GET']], //监督执行list
'officialReceiptsList' => ['api_broker/Performance/officialReceiptsList', ['method' => 'POST|GET']], //实收list
'housingResource' => ['api_broker/Performance/housingResource', ['method' => 'POST|GET']], //获取房源list
'userResource' => ['api_broker/Performance/userResource', ['method' => 'POST|GET']], //获取客源list
'followList' => ['api_broker/Performance/followList', ['method' => 'POST|GET']], //报备list
'marchInList' => ['api_broker/Performance/marchInList', ['method' => 'POST|GET']], //进场list
'paylogList' => ['api_broker/Performance/paylogList', ['method' => 'POST|GET']], //收款list
'performanceList' => ['api_broker/Performance/performanceList', ['method' => 'POST|GET']], //业绩list
'superviseList' => ['api_broker/Performance/superviseList', ['method' => 'POST|GET']], //监督执行list
'officialReceiptsList' => ['api_broker/Performance/officialReceiptsList', ['method' => 'POST|GET']], //实收list
'collectionListByBargainId' => ['api_broker/Performance/collectionListByBargainId', ['method' => 'POST|GET']], //实收list
'paylogListPcInfo' => ['api_broker/Performance/paylogListPcInfo', ['method' => 'POST|GET']], //
'marchInListPcInfo' => ['api_broker/Performance/marchInListPcInfo', ['method' => 'POST|GET']], //
......
<?php
namespace app\task\controller;
/**
* Created by PhpStorm.
* User: fuju
* Date: 2019/2/27
* Time: 16:05
*/
use app\extra\RedisExt;
use app\model\AAgents;
use app\model\ASite;
class FrostAgentTask{
private $agentsModel;
private $table = 'u_phone_follow_up_';
private $date ;
private $siteModel;
private $redis_;
function __construct()
{
$this->agentsModel = new AAgents();
$this->date = date("Y-m-d",strtotime("-1 day"));
$this->siteModel = new ASite();
$this->redis_ = RedisExt::getRedis();
}
public function frostAgent(){
$num = $this->redis_->get("s_agent_suspend");
//大于30不合理,容错
if($num < 0 && $num >30){
return;
}
$site_arr = $this->siteModel->getSite("id,name,city,is_del", ["is_del" => 0]);
if (count($site_arr) <= 0) {
return;
}
$field = "count(1) as count,a.id";
$params["a.status"] = 0;
$params["a.level"] = 10;
foreach ($site_arr as $item) {
$table_name = $this->table . $item["id"] . "_" . $this->date;
$params["a.site_id"] = $item["id"];
$agent_arr = $this->agentsModel->selectFollowUpNumByAgent( $field,$table_name,$params,$num);
if(count($agent_arr) > 0){
$this->execute_update($agent_arr);
}
}
}
private function execute_update($agent_arr){
$ids = "";
foreach ($agent_arr as $item) {
$ids .= $item["id"] . ",";
}
$ids = rtrim($ids, ",");
$this->agentsModel->saveStatus("status","5",$ids);
}
}
\ No newline at end of file
......@@ -23,4 +23,4 @@
if(!doc.addEventListener) return;
win.addEventListener(resizeEvt, recalc, false);
doc.addEventListener('DOMContentLoaded', recalc, false);
})(document, window);</script><link href=./static/css/app.8e7a1294243657c878b001aee61ce09a.css rel=stylesheet></head><body><div id=app></div><script src=https://api.tonglianjituan.com/app/js/libs/vue.min.js></script><script src=https://api.tonglianjituan.com/app/js/libs/vue-router.min.js></script><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.1b35a927314506fe4a4f.js></script><script type=text/javascript src=./static/js/app.95bcdcbc5ae5c04a833f.js></script></body></html>
\ No newline at end of file
})(document, window);</script><link href=./static/css/app.fb0495c45d8e8f4a215b24c757e3a74d.css rel=stylesheet></head><body><div id=app></div><script src=https://api.tonglianjituan.com/app/js/libs/vue.min.js></script><script src=https://api.tonglianjituan.com/app/js/libs/vue-router.min.js></script><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.1b35a927314506fe4a4f.js></script><script type=text/javascript src=./static/js/app.ea8ef220e6c195a1a4bc.js></script></body></html>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -192,6 +192,12 @@ require(['vue', 'css!style/timeline_pc.css', 'jquery0325', 'common'],function(Vu
return '其他';
case '70' :
return '银满谷银行卡';
case '71' :
return '筠姐上海银行卡';
case '72' :
return '林老师建行卡';
case '73' :
return '新同联福居银行卡';
default:
return '未定义';
}
......
......@@ -188,7 +188,10 @@
"pos": that.dataTotalList.data.pos,
"other_bank": that.dataTotalList.data.other_bank,
"daily_date" : that.time,
"bank_card" : that.dataTotalList.data.bank_card
"bank_card" : that.dataTotalList.data.bank_card,
"bank_card_yun" : that.dataTotalList.data.bank_card_yun,
"bank_card_lin" : that.dataTotalList.data.bank_card_lin,
"bank_card_new" : that.dataTotalList.data.bank_card_new,
};
that.axios({
method: 'get',
......@@ -284,6 +287,7 @@
initAgencyList : function(list){
let that = this ;
console.log(list);
var listArray = [{
"msg" : "收款ID" ,
"str1" : list.length > 0 ? (list[0].id ? list[0].id : "-") :"-",
......@@ -368,6 +372,12 @@
"str2" : list.length > 1 ? (list[1].is_dividend == 1 ? "否" : "是") :"-",
"str3" : list.length > 2 ? (list[2].is_dividend == 1 ? "否" : "是") :"-",
},
{
"msg" : "入账日期" ,
"str1" : list.length > 0 ? (list[0].income_time ? list[0].income_time : "-") :"-",
"str2" : list.length > 1 ? (list[1].income_time ? list[1].income_time : "-") :"-",
"str3" : list.length > 2 ? (list[2].income_time ? list[2].income_time : "-") :"-",
},
{
"msg" : "资料" ,
"id1" : list.length > 0 ? (list[0].id ? list[0].id : "-") :"-",
......@@ -465,6 +475,12 @@
"str2" : list.length > 1 ? (list[1].remark ? list[1].remark : "-") :"-",
"str3" : list.length > 2 ? (list[2].remark ? list[2].remark : "-") :"-",
},
{
"msg" : "入账日期" ,
"str1" : list.length > 0 ? (list[0].income_time != "" ? list[0].income_time : "-") :"-",
"str2" : list.length > 1 ? (list[1].income_time != "" ? list[1].income_time : "-") :"-",
"str3" : list.length > 2 ? (list[2].income_time != "" ? list[2].income_time : "-") :"-",
},
{
"msg" : "资料" ,
"id1" : list.length > 0 ? (list[0].id ? list[0].id : "-") :"-",
......@@ -545,6 +561,12 @@
"str2" : list.length > 1 ? (list[1].receipt_number ? list[1].receipt_number : "-") :"-",
"str3" : list.length > 2 ? (list[2].receipt_number ? list[2].receipt_number : "-") :"-",
},
{
"msg" : "入账日期" ,
"str1" : list.length > 0 ? (list[0].income_time != "" ? list[0].income_time : "-") :"-",
"str2" : list.length > 1 ? (list[1].income_time != "" ? list[1].income_time : "-") :"-",
"str3" : list.length > 2 ? (list[2].income_time != "" ? list[2].income_time : "-") :"-",
},
{
"msg" : "资料" ,
"id1" : list.length > 0 ? (list[0].id ? list[0].id : "-") :"-",
......@@ -619,6 +641,12 @@
"str2" : list.length > 1 ? (list[1].receipt_number ? list[1].receipt_number : "-") :"-",
"str3" : list.length > 2 ? (list[2].receipt_number ? list[2].receipt_number : "-") :"-",
},
{
"msg" : "入账日期" ,
"str1" : list.length > 0 ? (list[0].income_time != "" ? list[0].income_time : "-") :"-",
"str2" : list.length > 1 ? (list[1].income_time != "" ? list[1].income_time : "-") :"-",
"str3" : list.length > 2 ? (list[2].income_time != "" ? list[2].income_time : "-") :"-",
},
{
"msg" : "资料" ,
"id1" : list.length > 0 ? (list[0].id ? list[0].id : "-") :"-",
......@@ -765,6 +793,15 @@
case '70':
str = "银满谷银行卡" ;
break ;
case '71':
str = "筠姐上海银行卡" ;
break ;
case '72':
str = "林老师建行卡" ;
break ;
case '73':
str = "新同联福居银行卡" ;
break ;
}
console.log(str);
return str ;
......
......@@ -35,7 +35,7 @@
<div class="halfDiv" v-if="data.data.tenpay_2!=0&& data.area != 10003">
<span>林老师微信:{{ data.data.tenpay_2 }}</span>
</div>
<div class="halfDiv" v-if="data.data.bank_card!=0 && data.area == 10003">
<div class="halfDiv" v-if="data.data.bank_card!=0 && data.area == 10002">
<span>银满谷银行卡:{{ data.data.bank_card }}</span>
</div>
<div class="halfDiv" v-if="data.data.realty_pay!=0">
......@@ -50,6 +50,15 @@
<div class="halfDiv" v-if="data.data.cash!=0">
<span>现金:{{ data.data.cash }}</span>
</div>
<div class="halfDiv" v-if="data.data.bank_card_yun!=0 && data.area == 10003">
<span>筠姐上海银行卡:{{ data.data.bank_card_yun }}</span>
</div>
<div class="halfDiv" v-if="data.data.bank_card_lin!=0 && data.area == 10002">
<span>林老师建行卡:{{ data.data.bank_card_lin }}</span>
</div>
<div class="halfDiv" v-if="data.data.bank_card_new!=0 && data.area == 10001">
<span>新同联福居银行卡:{{ data.data.bank_card_new }}</span>
</div>
<div class="halfDiv" v-if="data.data.pos!=0">
<span>POS机:{{ data.data.pos }}</span>
</div>
......
......@@ -162,7 +162,46 @@
</ul>
</section>
<section v-show="3 === initTabNumMain">
<ul class="li-box" v-for="(item,index) in getItem">
<li class="main-sec-li no-background-color">
<div class="special-style">提交时间:<span class="margin-left">{{ item.create_time}}</span></div>
</li>
<li class="main-sec-li no-background-color">
<div class="special-style">入账日期:<span class="margin-left">{{ item.income_time}}</span></div>
</li>
<li class="main-sec-li half no-background-color">
<div class="special-style">提交人:<span class="margin-left">{{ item.name}}</span></div>
</li>
<li class="main-sec-li half no-background-color">
<div class="special-style">收款ID:<span class="margin-left">{{ item.id}}</span></div>
</li>
<li class="main-sec-li half no-background-color">
<div class="special-style">提交报告ID:<span class="margin-left">{{ item.bargain_id}}</span></div>
</li>
<li class="main-sec-li half no-background-color">
<div class="special-style">入账金额:<span class="margin-left">{{ item.money}}</span></div>
</li>
<li class="main-sec-li half no-background-color">
<div class="special-style">入账类型:<span class="margin-left">{{ getIntoType(item.type)}}</span></div>
</li>
<li class="main-sec-li half no-background-color">
<div class="special-style">来源:<span class="margin-left">{{ getComeFrom(item.source)}}</span></div>
</li>
<li class="main-sec-li half no-background-color">
<div class="special-style">对应业务员:<span class="margin-left">{{ item.salesman}}</span></div>
</li>
<li class="main-sec-li half no-background-color">
<div class="special-style">状态:<span class="margin-left">{{ getStatus(item.source,item.is_refund)}}</span></div>
</li>
<li class="main-sec-li no-background-color">
<div class="special-style">所属门店:<span class="margin-left">{{ item.store_name}}</span></div>
</li>
</ul>
</section>
</main>
<!--<footer class="tc ">
......@@ -184,6 +223,8 @@
'title': '分佣提成',
}, {
'title': '开票税费',
}, {
'title': '收款信息',
}],
internal_title: '',
internal_address: '',
......@@ -204,7 +245,8 @@
industry_type:'',
bargainInfo_id : '',
house_id : '',
user_id : ''
user_id : '',
getItem : ""
}),
created() {
......@@ -218,6 +260,74 @@
_this.loadMain();
},
methods: {
getIntoType : function(no){
var str = ""
switch ( no ) {
case 10 :
str = "意向金" ;
break ;
case 20 :
str = "定金" ;
break ;
case 30 :
str = "保管金" ;
break ;
case 40 :
str = "押金" ;
break ;
case 50 :
str = "租金" ;
break ;
case 60 :
str = "进场费" ;
break ;
case 70 :
str = "转让费" ;
break ;
case 80 :
str = "其他" ;
break ;
case 90 :
str = "佣金" ;
break ;
case 91 :
str = "中介费" ;
break ;
case 92 :
str = "案场费" ;
break ;
}
return str ;
},
getComeFrom : function (no){
var str = ""
switch ( no ) {
case 0:
str = "app" ;
break ;
case 1 :
str = "智能pos机" ;
break ;
case 2 :
str = "调整" ;
break ;
}
return str ;
},
getStatus : function(source,is_refund){
var that = this ;
var str = ""
if ( source==2 && is_refund == 1 ) {
str ="被调整+被退款";
} else if (source==2){
str ="被调整";
} else if (is_refund == 1){
str ="被退款";
} else {
str ="正常";
}
return str ;
},
urlImg(u) {
let _this = this;
console.log(_this.common.ServerHost + '/app/images/' +u);
......@@ -225,6 +335,7 @@
},
loadMain() {
let _this = this;
_this.collectionBargain();
_this.ajaxUl();
},
tabMain(index) {
......@@ -260,9 +371,28 @@
layer.tipsX('分佣方类型判断错误');
}
},
collectionBargain : function() {
let that = this;
that.axios({
method: 'get',
url: 'broker/collectionListByBargainId',
responseType: 'json',
data: {
bargain_id: that.bargain_id,
// agent_id : 5775,
AuthToken: that.token,
}
})
.then(function(response) {
if(response.data.code == 200&&response.data.data.length!=0) {
var data = response.data.data ;
that.getItem = data ;
}
});
},
ajaxUl() {
let _this = this;
_this.axios({
method: 'get',
url: 'broker/bargainDetail',
......@@ -409,6 +539,26 @@
font-size: .3rem;
}
.li-box {
/*padding :.1rem;*/
border : 1px solid #D2D2D2 ;
overflow : hidden ;
width :7.1rem;
margin : .2rem;
/*background-color : #D2D2D2;*/
}
.half {
width : 2.75rem;
float : left ;
}
.no-background-color {
background-color:initial;
}
.special-style{
font-size:.28rem;
color : #999999;
line-height : 2;
}
.main-sec-li-26 {
background: #fff;
line-height: .9rem;
......@@ -434,6 +584,12 @@
float: right;
}
.margin-left {
margin-left : .1rem ;
color : #1A1A1A;
line-height : 1;
}
.color {
color: #FA903F;
}
......
......@@ -205,12 +205,40 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
dataType: "json",
success: function(data) {
if(data.code != 200) {
alert("禁用失败!")
alert(data.msg)
}
}
});
});
//解除自动锁定
$(document).on('click','.automatic-locking',function(e){
var params={};
params.id = $(this).attr("data-id");
if(!confirm('是否解锁此账号为正常状态?')) {
return;
};
var hideAutomatic={};
hideAutomatic=$(this);
$.ajax({ //经纪人
'type': 'POST',
'url': '/index/updateStatus',
data: {
"ids": params.id,
"status": 0
},
dataType: "json",
success: function(data) {
if(data.code == 200) {
hideAutomatic.hide();
// console.log( $(this));
}else{
alert(data.msg)
}
}
});
});
//手机绑定状态切换
$(document).delegate(".is_show2", "click", function() { //点击禁用
if(!confirm('是否继续?')) {
......
......@@ -233,7 +233,7 @@ define (['doT', 'text!temp/banner_template_tpl.html', 'ckfinder', 'ckfinderStart
formData.append('image', _this[0].files[0]);
$.ajax({
type: 'post',
url: 'https://images.tonglianjituan.com/index/uploadImg',
url: ServerHostImageLiu+'/index/uploadImg',
data: formData,
dataType: 'json',
contentType: false,
......
......@@ -380,15 +380,46 @@ define(['doT', 'text!temp/financial_manager_daily_list_template_tpl.html', 'css!
//总计commit_info
bargain.daily_id = data.data.commit_info.id;
//深圳 和 杭州上海
if(bargain.caiwu_site_id == 10003){
if(bargain.caiwu_site_id == 10003){//深圳
$('#pay_yun_zhihubao').html(data.data.commit_info.alipay);
$('#pay_yun_weixin').html(data.data.commit_info.tenpay);
$('#pay_yun_card').html(data.data.commit_info.bank_card);
$('#pay_yun_bank').html(data.data.commit_info.bank_card_yun);
$('#pay_yun_pos').html(data.data.commit_info.pos);
$('#pay_yun_family').html(data.data.commit_info.family_pay);
$('.shenzhen').show();
$('.shanghai').hide();
}else{
$('.hangzhou').hide();
// "bank_card_yun" => "2323",
// "bank_card_lin"=>"1213",
// "bank_card_new"=>"123123"
}else if(bargain.caiwu_site_id == 10002){ //杭州
$('.shenzhen').hide();
$('.shanghai').hide();
$('.hangzhou').show();
$('#pay_a_hangzhou').html(data.data.commit_info.alipay);
$('#pay_a1_hangzhou').html(data.data.commit_info.alipay_2);
$('#pay_b_hangzhou').html(data.data.commit_info.tenpay);
$('#pay_b1_hangzhou').html(data.data.commit_info.tenpay_2);
$('#pay_c_hangzhou').html(data.data.commit_info.realty_pay);
$('#pay_d_hangzhou').html(data.data.commit_info.family_pay);
$('#pay_e_hangzhou').html(data.data.commit_info.private_bank);
$('#pay_f_hangzhou').html(data.data.commit_info.cash);
$('#pay_g_hangzhou').html(data.data.commit_info.pos);
$('#pay_h_hangzhou').html(data.data.commit_info.other_bank);
$('#pay_g_hangzhou').html(data.data.commit_info.pos);
$('#pay_h_hangzhou').html(data.data.commit_info.other_bank);
$('#pay_k_hangzhou').html(data.data.commit_info.bank_card);
$('#pay_m_hangzhou').html(data.data.commit_info.bank_card_lin);
}else{//上海
$('.shenzhen').hide();
$('.shanghai').show();
$('.hangzhou').hide();
$('#pay_a').html(data.data.commit_info.alipay);
$('#pay_a1').html(data.data.commit_info.alipay_2);
$('#pay_b').html(data.data.commit_info.tenpay);
......@@ -399,6 +430,8 @@ define(['doT', 'text!temp/financial_manager_daily_list_template_tpl.html', 'css!
$('#pay_f').html(data.data.commit_info.cash);
$('#pay_g').html(data.data.commit_info.pos);
$('#pay_h').html(data.data.commit_info.other_bank);
$('#pay_k').html(data.data.commit_info.bank_card);
$('#pay_m').html(data.data.commit_info.bank_card_new);
}
$('#pay_i').html(data.data.commit_info.agent_name);
......@@ -422,15 +455,37 @@ define(['doT', 'text!temp/financial_manager_daily_list_template_tpl.html', 'css!
$('.audit-records').hide();
$('.tips-dian').html('');
//未提交 店长
if(bargain.caiwu_site_id == 10003){
if(bargain.caiwu_site_id == 10003){//深圳
$('#pay_yun_zhihubao').html(data.data.total_info.alipay);
$('#pay_yun_weixin').html(data.data.total_info.tenpay);
$('#pay_yun_card').html(data.data.total_info.bank_card);
$('#pay_yun_bank').html(data.data.total_info.bank_card_yun);
$('#pay_yun_pos').html(data.data.total_info.pos);
$('#pay_yun_family').html(data.data.total_info.family_pay);
$('.shenzhen').show();
$('.shanghai').hide();
}else{
$('.hangzhou').hide();
}else if(bargain.caiwu_site_id == 10002){//杭州
$('.shenzhen').hide();
$('.shanghai').hide();
$('.hangzhou').show();
$('#pay_a_hangzhou').html(data.data.total_info.alipay);
$('#pay_a1_hangzhou').html(data.data.total_info.alipay_2);
$('#pay_b_hangzhou').html(data.data.total_info.tenpay);
$('#pay_b1_hangzhou').html(data.data.total_info.tenpay_2);
$('#pay_c_hangzhou').html(data.data.total_info.realty_pay);
$('#pay_d_hangzhou').html(data.data.total_info.family_pay);
$('#pay_e_hangzhou').html(data.data.total_info.private_bank);
$('#pay_f_hangzhou').html(data.data.total_info.cash);
$('#pay_g_hangzhou').html(data.data.total_info.pos);
$('#pay_h_hangzhou').html(data.data.total_info.other_bank);
$('#pay_k_hangzhou').html(data.data.total_info.bank_card);
$('#pay_m_hangzhou').html(data.data.total_info.bank_card_lin);
}else{//上海
$('.shenzhen').hide();
$('.shanghai').show();
$('.hangzhou').hide();
$('#pay_a').html(data.data.total_info.alipay);
$('#pay_a1').html(data.data.total_info.alipay_2);
$('#pay_b').html(data.data.total_info.tenpay);
......@@ -441,6 +496,8 @@ define(['doT', 'text!temp/financial_manager_daily_list_template_tpl.html', 'css!
$('#pay_f').html(data.data.total_info.cash);
$('#pay_g').html(data.data.total_info.pos);
$('#pay_h').html(data.data.total_info.other_bank);
$('#pay_k').html(data.data.total_info.bank_card);
$('#pay_m').html(data.data.total_info.bank_card_new);
}
$('#pay_i').html('');
......@@ -492,16 +549,37 @@ define(['doT', 'text!temp/financial_manager_daily_list_template_tpl.html', 'css!
$('#maintable_list_total').show();
}
//杭州 上海
if(bargain.caiwu_site_id == 10003){
//杭州 上海 深圳
if(bargain.caiwu_site_id == 10003){//深圳
$('.shenzhen').show();
$('.shanghai').hide();
$('.hangzhou').hide();
$('#total_yun_zhihubao').html(data.data.total_info.alipay);
$('#total_yun_weixin').html(data.data.total_info.tenpay);
$('#total_yun_card').html(data.data.total_info.bank_card);
}else{
$('#total_yun_bank').html(data.data.total_info.bank_card_yun);
$('#total_yun_pos').html(data.data.total_info.pos);
$('#total_yun_family').html(data.data.total_info.family_pay);
}else if(bargain.caiwu_site_id == 10002){//杭州
$('.shenzhen').hide();
$('.shanghai').hide();
$('.hangzhou').show();
$('#total_a_hangzhou').html(data.data.total_info.alipay);
$('#total_a1_hangzhou').html(data.data.total_info.alipay_2);
$('#total_b1_hangzhou').html(data.data.total_info.tenpay_2);
$('#total_b_hangzhou').html(data.data.total_info.tenpay);
$('#total_c_hangzhou').html(data.data.total_info.realty_pay);
$('#total_d_hangzhou').html(data.data.total_info.family_pay);
$('#total_e_hangzhou').html(data.data.total_info.private_bank);
$('#total_f_hangzhou').html(data.data.total_info.cash);
$('#total_g_hangzhou').html(data.data.total_info.pos);
$('#total_h_hangzhou').html(data.data.total_info.other_bank);
$('#total_m_hangzhou').html(data.data.total_info.bank_card);
$('#total_n_hangzhou').html(data.data.total_info.bank_card_lin);
}else{//上海
$('.shenzhen').hide();
$('.shanghai').show();
$('.hangzhou').hide();
$('#total_a').html(data.data.total_info.alipay);
$('#total_a1').html(data.data.total_info.alipay_2);
$('#total_b1').html(data.data.total_info.tenpay_2);
......@@ -512,6 +590,8 @@ define(['doT', 'text!temp/financial_manager_daily_list_template_tpl.html', 'css!
$('#total_f').html(data.data.total_info.cash);
$('#total_g').html(data.data.total_info.pos);
$('#total_h').html(data.data.total_info.other_bank);
$('#total_m').html(data.data.total_info.bank_card);
$('#total_n').html(data.data.total_info.bank_card_new);
}
$('#total_i').html('');
......@@ -590,13 +670,34 @@ define(['doT', 'text!temp/financial_manager_daily_list_template_tpl.html', 'css!
params.agent_name=user_info_obj.name;
// 判断 深圳 杭州
if(bargain.caiwu_site_id == 10003){
if(bargain.caiwu_site_id == 10003){//深圳
params.alipay=$('#pay_yun_zhihubao').html();
params.tenpay=$('#pay_yun_weixin').html();
params.bank_card=$('#pay_yun_card').html();
params.bank_card_yun=$('#pay_yun_bank').html();
params.pos=$('#pay_yun_pos').html();
params.family_pay=$('#pay_yun_family').html();
//深圳店长提交 没有的数据传空
params.realty_pay='';
params.other_bank='';
params.cash='';
params.private_bank='';
}else{
params.alipay=$('#pay_a').html();
}else if(bargain.caiwu_site_id == 10002){//杭州
params.alipay=$('#pay_a_hangzhou').html();
params.alipay_2=$('#pay_a1_hangzhou').html();
params.tenpay=$('#pay_b_hangzhou').html();
params.tenpay_2=$('#pay_b1_hangzhou').html();
params.realty_pay=$('#pay_c_hangzhou').html();
params.family_pay=$('#pay_d_hangzhou').html();
params.private_bank=$('#pay_e_hangzhou').html();
params.cash=$('#pay_f_hangzhou').html();
params.pos=$('#pay_g_hangzhou').html();
params.other_bank=$('#pay_h_hangzhou').html();
params.bank_card=$('#pay_k_hangzhou').html();
params.bank_card_lin=$('#pay_m_hangzhou').html();
}else{//上海
params.alipay=$('#pay_a').html();
params.alipay_2=$('#pay_a1').html();
params.tenpay=$('#pay_b').html();
params.tenpay_2=$('#pay_b1').html();
......@@ -606,7 +707,8 @@ define(['doT', 'text!temp/financial_manager_daily_list_template_tpl.html', 'css!
params.cash=$('#pay_f').html();
params.pos=$('#pay_g').html();
params.other_bank=$('#pay_h').html();
params.bank_card=$('#pay_k').html();
params.bank_card_new=$('#pay_m').html();
};
$.ajax({
url: '/index/addDaily',
......@@ -659,13 +761,30 @@ define(['doT', 'text!temp/financial_manager_daily_list_template_tpl.html', 'css!
params.agent_name=user_info_obj.name;
params.remark=(bargain.operationStatus)*1?'审核通过':($.trim($('.remark-financial').val()));
params.operation_status=bargain.operationStatus//0审核通过 1转为已审核
if(bargain.caiwu_site_id == 10003){
if(bargain.caiwu_site_id == 10003){//深圳
params.alipay=$('#total_yun_zhihubao').html();
params.tenpay=$('#total_yun_weixin').html();
params.bank_card=$('#total_yun_card').html();
params.bank_card_yun=$('#total_yun_bank').html();
params.pos=$('#total_yun_pos').html();
params.family_pay=$('#total_yun_family').html();
}else if(bargain.caiwu_site_id == 10002){//杭州
params.alipay=$('#total_a_hangzhou').html();
params.alipay_2=$('#total_a1_hangzhou').html();
params.tenpay=$('#total_b_hangzhou').html();
params.tenpay_2=$('#total_b1_hangzhou').html();
params.realty_pay=$('#total_c_hangzhou').html();
params.family_pay=$('#total_d_hangzhou').html();
params.private_bank=$('#total_e_hangzhou').html();
params.cash=$('#total_f_hangzhou').html();
params.pos=$('#total_g_hangzhou').html();
params.other_bank=$('#total_h_hangzhou').html();
params.bank_card=$('#total_m_hangzhou').html();
params.bank_card_lin=$('#total_n_hangzhou').html();
}else{
params.alipay=$('#total_a').html();
}else{//上海
params.alipay=$('#total_a').html();
params.alipay_2=$('#total_a1').html();
params.tenpay=$('#total_b').html();
params.tenpay_2=$('#total_b1').html();
......@@ -675,7 +794,8 @@ define(['doT', 'text!temp/financial_manager_daily_list_template_tpl.html', 'css!
params.cash=$('#total_f').html();
params.pos=$('#total_g').html();
params.other_bank=$('#total_h').html();
params.bank_card=$('#total_m').html();
params.bank_card_new=$('#total_n').html();
};
$.ajax({
url: '/index/commitCheck',
......@@ -730,6 +850,22 @@ define(['doT', 'text!temp/financial_manager_daily_list_template_tpl.html', 'css!
},'json')
},
getValueFunction : function(data){
var user_info_obj = JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo'))); //读取缓存
if(user_info_obj.site_id == 10001){
$('.shanghaipayType').show();
$('.hangzhoupayType').hide();
$('.shenzhengpayType').hide();
}else if(user_info_obj.site_id == 10002){
$('.shanghaipayType').hide();
$('.hangzhoupayType').show();
$('.shenzhengpayType').hide();
}else{
$('.shanghaipayType').hide();
$('.hangzhoupayType').hide();
$('.shenzhengpayType').show();
}
var persent = 0.7;
$('.zhzd').show();
$('.zjcon').hide();
var doc = $('#modal-addPic');
......@@ -771,6 +907,9 @@ define(['doT', 'text!temp/financial_manager_daily_list_template_tpl.html', 'css!
doc.find("#intoType").text('佣金');
} else if ( data.type == 91 ) {
doc.find("#intoType").text('中介费');
if ( doc.find('#agency_fees_type').val() == 1 ){
persent = 0 ;
}
$('.zhzd').hide();
} else if ( data.type == 92 ) {
doc.find("#intoType").text('案场费');
......@@ -791,8 +930,8 @@ define(['doT', 'text!temp/financial_manager_daily_list_template_tpl.html', 'css!
// doc.find("#getPrice").text(((data.price-0)*0.7 )+ "元");
// doc.find("#morePrice").text(Math.floor((data.money - ((data.price-0)*0.7))*100)/100 + "元");
// 保留两位小数
doc.find("#getPrice").text((Math.floor(((data.price-0)*0.7 )*100)/100).toFixed(2)+ "元");
doc.find("#morePrice").text((Math.floor((data.money - ((data.price-0)*0.7))*100)/100).toFixed(2) + "元");
doc.find("#getPrice").text((Math.floor(((data.price-0)*persent)*100)/100).toFixed(2)+ "元");
doc.find("#morePrice").text((Math.floor((data.money - ((data.price-0)*persent))*100)/100).toFixed(2) + "元");
$("#person").text(data.current_agent_name);
$("#belongT").text(data.store_name);
doc.find("#payType").val(data.pay_type);
......@@ -947,7 +1086,7 @@ define(['doT', 'text!temp/financial_manager_daily_list_template_tpl.html', 'css!
return bargain;
});
var sw=function(s){switch(Number(s)){case 10:return"施总支付宝";case 11:return"林老师支付宝";case 12:return"筠姐支付宝";case 20:return"施总微信";case 21:return"林老师微信";case 22:return"筠姐微信";case 30:return"POS机器";case 40:return"地产转账";case 41:return"世家公账";case 42:return"3000账号";case 50:return"现金";case 60:return"其他";case 70:return"银满谷银行卡";default:return s}};
var sw=function(s){switch(Number(s)){case 10:return"施总支付宝";case 11:return"林老师支付宝";case 12:return"筠姐支付宝";case 20:return"施总微信";case 21:return"林老师微信";case 22:return"筠姐微信";case 30:return"POS机器";case 40:return"地产转账";case 41:return"世家公账";case 42:return"3000账号";case 50:return"现金";case 60:return"其他";case 70:return"银满谷银行卡";case 71:return"筠姐上海银行卡";case 72:return"林老师建行卡";case 73:return"新同联福居银行卡";default:return s}};
var swtype=function(s){switch(Number(s)){case 1:return"意向金转中介费";case 2:return"意向金转案场费";case 3:return"意向金转意向金";case 4:return"保管金转中介费";case 5:return"保管金转案场费";case 6:return"保管金转保管金";case 7:return"意向金转保管金";default:return s}};
......
......@@ -352,8 +352,10 @@ define(['doT', 'text!temp/receivables_template_tpl.html', 'css!style/home.css',
//操作----详情
$(document).on('click','.add-status',function(e){
var id = e.target.dataset.id;
var orderId=$(this).attr("data-orderId");
// that.deleteId = id ;
that.getStatusList(id);
that.getStatusList(id,orderId);
});
//操作----删除
......@@ -1373,7 +1375,7 @@ define(['doT', 'text!temp/receivables_template_tpl.html', 'css!style/home.css',
var source_id = data.source_id ;
var is_refund = data.is_refund ;
if (data.source == 0) {
$("#comes").text('APP');
$("#comes").text('正常收款');
// doc.find("#status").text("正常");
$('#intoPrice').removeAttr("readonly");
$('#shoutiao').removeAttr("readonly");
......@@ -1382,7 +1384,7 @@ define(['doT', 'text!temp/receivables_template_tpl.html', 'css!style/home.css',
$('#payNo').removeAttr("readonly");
} else if (data.source == 1){
$("#comes").text('智能pos机');
$("#comes").text('正常收款');
$('#intoPrice').removeAttr("readonly");
$('#shoutiao').removeAttr("readonly");
// $('#payType').removeAttr("readonly");
......@@ -1390,7 +1392,7 @@ define(['doT', 'text!temp/receivables_template_tpl.html', 'css!style/home.css',
$('#payNo').removeAttr("readonly");
// doc.find("#status").text("正常");
} else {
$("#comes").text('正常收款');
$("#comes").text('调整');
$('#intoPrice').attr("readonly" , "readonly");
$('#shoutiao').attr("readonly" , "readonly");
// $('#payType').attr("readonly" , "readonly");
......@@ -1651,11 +1653,13 @@ define(['doT', 'text!temp/receivables_template_tpl.html', 'css!style/home.css',
* 获取表格数据
* @param {Object} no
*/
getStatusList : function(id){
getStatusList : function(id,orderId){
var that = receiv;
// that.pageNo = no;
var params = {
'pay_id' : id
'pay_id' : id,
'order_id' : orderId
}
// params.pageNo = that.pageNo;
// params.pageSize = that.pageSize ;
......
......@@ -11,10 +11,11 @@ define(['doT', 'text!temp/inspectionRecordAll_list_template_tpl.html', 'css!styl
ajaxObj: '',
stopstatus: true,
boxphoto: '',
mainTabIndex: 0,
url:'/broker/reportListForPc',
init: function() {
//初始化dot
$(document.body).append(template);
record.event();
},
......@@ -94,7 +95,50 @@ define(['doT', 'text!temp/inspectionRecordAll_list_template_tpl.html', 'css!styl
document.getElementById("form_search").reset();
$('#guest_stores').html('');
});
_doc.on('click', '.maintable-top-sub-tr>a', function(e){
e.preventDefault();
e.stopPropagation();
var _this = $(this);
_this.removeClass('btn-default').addClass('btn-info').siblings().removeClass('btn-info').addClass('btn-default');
record.mainTabIndex = _this.index();
record.getList(1);
});
if (!check_auth('index/inspectionRecordStore/1')) {
$("#is_show_store").hide();
}
if (!check_auth('index/inspectionRecordDistrict/2')) {
$("#is_show_district").hide();
}
if (!check_auth('index/inspectionRecordAll/3')) {
$("#is_show_all").hide();
}
$("#our").click(function () {
record.url = "/broker/reportListForPc";
});
$("#is_show_store").click(function () {
record.url = "/index/inspectionRecordStore/1";
});
$("#is_show_district").click(function () {
record.url = "/index/inspectionRecordDistrict/2";
});
$("#is_show_all").click(function () {
record.url = "/index/inspectionRecordAll/3";
});
},
//获取一级审核,二级审核,三级审核,结单不同的ajax请求url
switchUrl: function(){
switch (Number(this.mainTabIndex)){
case 0:
return '/index/inspectionRecordAll/3';
case 1:
return '/index/inspectionRecordDistrict/2';
case 2:
return '/index/inspectionRecordStore/1';
default:
return '';
}
},
getList: function(pageNo) { //获取约带看记录列表
record.pageNo = pageNo;//接收参数
......@@ -107,8 +151,10 @@ define(['doT', 'text!temp/inspectionRecordAll_list_template_tpl.html', 'css!styl
params.internal_title = $('#house_title').val();
params.user_phone = $('#report_agent_phone').val();
params.order_id = $('#report_id').val();//全部约带看记录 订单id搜索
params.AuthToken = user_info_obj.AuthToken;
params.type = 1;
params.agent_id = user_info_obj.id;
// var start_ = $('#create_time_start').val()+" 00:00:00";
// date_start =new Date(Date.parse(start_.replace(/-/g, "/")));
// params.start_time =date_start.getTime()*0.001;
......@@ -122,7 +168,8 @@ define(['doT', 'text!temp/inspectionRecordAll_list_template_tpl.html', 'css!styl
params.pageSize = record.pageSize;
$.ajax({
type: 'GET',
url: '/index/inspectionRecordAll', //约带看记录 对接接口(2.9.6 有权限的人 才能看到)
// url: record.switchUrl(), //约带看记录 对接接口(2.9.6 有权限的人 才能看到)
url: record.url, //约带看记录 对接接口(2.9.6 有权限的人 才能看到)
data: params,
timeout: 30000,
dataType: 'json',
......@@ -131,12 +178,13 @@ define(['doT', 'text!temp/inspectionRecordAll_list_template_tpl.html', 'css!styl
if(typeof data === 'object') {
if(data.code == 200) {
var doTtmpl = doT.template(document.getElementById('inspectionRecordAll_list_tpl').innerHTML);
$("#follow_list").html(doTtmpl(data.data.list));
if (data.data.list) {
$("#follow_list").html(doTtmpl(data.data.list));
} else {
$("#follow_list").html(doTtmpl(data.data));
}
/*分页代码*/
console.log(data.data.total);
add_page(data.data.total, pageNo, record.pageSize, record.getList);
// $(".move-block").html(' ');
} else {
alert(data['msg']);
};
......
......@@ -210,7 +210,9 @@ define(['doT', 'css!style/home.css', 'ckfinder', 'ckfinderStart', "datetimepick
'3': v.report_agent_name,
'4': ba,
'5': ServerHostImageLiu+"/static/chat_image/" + ((Array.isArray(v.march_in_img)&&v.march_in_img.length)?v.march_in_img[0].img_name:''),
'6': check_auth('marchIn_timer_shaft')?_aTemp:''
'6': check_auth('marchIn_timer_shaft')?_aTemp:'',
'7': v.order_id
});
funTemp(++count);
});
......
......@@ -14,18 +14,25 @@ define (['doT', 'ckfinder','ckfinderStart', 'css!style/home.css',"datetimepicker
agent_id_two:'',
agent_id2 : 0,
modal_btn_id : '' ,
loadListStatus : false ,
init: function () {
//初始化dot
// performanceRanking.addDark();
performanceRanking.event ();
// performanceRanking.loadTableData();
// performanceRanking.loadTable2Data();
performanceRanking.loadBusinessSchool();
performanceRanking.loadNotice();
performanceRanking.loadWinerData();
performanceRanking.loadCity();
// performanceRanking.loadWinerData();
performanceRanking.businessNews();
// performanceRanking.loadTableData();
// performanceRanking.loadTable2Data();
// performanceRanking.loadTables();
},
loadTables : function(){
performanceRanking.loadTableData();
performanceRanking.loadTable2Data();
},
event: function () {
var that = this ;
that.initDate();
......@@ -56,6 +63,10 @@ define (['doT', 'ckfinder','ckfinderStart', 'css!style/home.css',"datetimepicker
});
$(document).on('change','#orderCity',function(e){
performanceRanking.loadWinerData($(this).val());
})
$(document).on('click','.table-choose', function(e){
// $('.table-choose').click(function(){
if ($(this).hasClass("active")){
......@@ -95,6 +106,25 @@ define (['doT', 'ckfinder','ckfinderStart', 'css!style/home.css',"datetimepicker
},
loadCity : function(){
var that = this ;
$.get('/index/getSiteList',function(data){
console.log(data);
var datas= data.data.list ;
var tag = '' ;
for ( var i = 0 ; i < datas.length ;i++ ){
tag += '<option value="'+ datas[i].id +'">'+ datas[i].name +'</options>'
}
$('#orderCity').append(tag);
// var id = datas[0].id ? datas[0].id : 10001;
// alert($('.user_city_choose_site').val())
var id = JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo'))).site_id;
$('#orderCity').val(id)
performanceRanking.loadWinerData(id);
})
},
initDate : function(){
var date = new Date();
var year = date.getFullYear();
......@@ -251,10 +281,10 @@ define (['doT', 'ckfinder','ckfinderStart', 'css!style/home.css',"datetimepicker
},
loadWinerData : function(){
loadWinerData : function(city){
var that = performanceRanking ;
var params = {
'site_id' : 10001
'site_id' : city
}
$.get('/index/selectPkSortByTime',params , function(data){
var url = data.data.api_path;
......@@ -262,13 +292,16 @@ define (['doT', 'ckfinder','ckfinderStart', 'css!style/home.css',"datetimepicker
var store_sort = data.data.store_sort;
that.initStoreSort(store_sort,url);
that.initAgentSort(agent_sort,url);
if ( !that.loadListStatus ) {
performanceRanking.loadTables();
}
})
} ,
initStoreSort : function(data,url){
var that = this ;
var tag = '' ;
$('#teamList').empty();
for ( var i = 0 ; i < data.length ; i++ ){
var imgUrl = '' ;
if (data[i].img == ""){
......@@ -286,16 +319,6 @@ define (['doT', 'ckfinder','ckfinderStart', 'css!style/home.css',"datetimepicker
tag += ' <image src="'+ imgUrl +'"></image>';
tag += ' </div>';
tag += ' <div class="name-area">';
// if ( i == 0 ){
// tag += ' <image src="/resource/image/first.png" style="width:0.24rem;height:0.171rem"></image>';
// } else if ( i == 1){
// tag += ' <image src="/resource/image/second.png" style="width:0.24rem;height:0.171rem"></image>';
// } else if (i == 2){
// tag += ' <image src="/resource/image/third.png" style="width:0.24rem;height:0.171rem"></image>';
// } else {
//
// }
// tag += ' <image src="/resource/image/first.png" style="width:0.24rem;height:0.171rem"></image>';
tag += ' <span>'+data[i].store_name+'</span>';
tag += ' </div>';
tag += '</div>';
......@@ -307,7 +330,7 @@ define (['doT', 'ckfinder','ckfinderStart', 'css!style/home.css',"datetimepicker
initAgentSort : function(data,url){
var that = this ;
var tag = '' ;
$('#personList').empty();
for ( var i = 0 ; i < data.length ; i++ ){
var imgUrl = '' ;
if (data[i].img == ""){
......@@ -325,23 +348,12 @@ define (['doT', 'ckfinder','ckfinderStart', 'css!style/home.css',"datetimepicker
tag += ' <image src="'+ imgUrl +'"></image>';
tag += ' </div>';
tag += ' <div class="name-area">';
// if ( i == 0 ){
// tag += ' <image src="/resource/image/first.png" style="width:0.24rem;height:0.171rem"></image>';
// } else if ( i == 1){
// tag += ' <image src="/resource/image/second.png" style="width:0.24rem;height:0.171rem"></image>';
// } else if (i == 2){
// tag += ' <image src="/resource/image/third.png" style="width:0.24rem;height:0.171rem"></image>';
// } else {
//
// }
// tag += ' <image src="/resource/image/first.png" style="width:0.24rem;height:0.171rem"></image>';
tag += ' <span>'+data[i].name+'</span>';
tag += ' </div>';
tag += '</div>';
}
$('#personList').append(tag);
},
//
loadTableData : function(){
var that = performanceRanking ;
......@@ -361,6 +373,7 @@ define (['doT', 'ckfinder','ckfinderStart', 'css!style/home.css',"datetimepicker
dataType: 'json',
success: function(data) {
if (data.code == 200 ){
that.loadListStatus = true ;
$('#tbody1').empty();
that.loadTable(data.data.list,data.data.grade);
var grade = data.data.grade ;
......
......@@ -153,7 +153,7 @@ define(['doT', 'text!temp/refund_template_tpl.html', 'css!style/home.css', 'ckfi
formData.append('image', _this[0].files[0]);
$.ajax({
type: 'post',
url: '/index/uploadImg',
url: ServerHostImageLiu+'/index/uploadImg',
data: formData,
dataType: 'json',
contentType: false,
......
......@@ -350,10 +350,8 @@ define(['doT', 'text!temp/store_template_tpl.html', 'css!style/home.css', 'ckfin
data: {
"phone":$("#set_father_id3").val(),
"level": "10,30,40",
"site_id":user_info_obj.site_id,
"store_id":store.house_id
// "store_id":store.house_id,
"all":1,
},
dataType: 'json',
success: function (data) {
......@@ -363,11 +361,9 @@ define(['doT', 'text!temp/store_template_tpl.html', 'css!style/home.css', 'ckfin
user_ul+='<li class="addphone" data-id="'+item.id+'">'+item.id+'-'+item.name+'-'+item.phone+'</li>';
});
$(".user-ul").html(user_ul);
} else {
alert(data.msg);
}
}
});
},
......
......@@ -51,7 +51,11 @@
<a class="btn1 btn-info yetai_checkbox" data-toggle="modal" data-id='[%= it[item]["id"] %]' data-status='[%= it[item]["status"] %]'>长假</a>
[% } %]
<a class="btn1 btn-default btn-default-show-caozuo">>>></a>
[% if(it[item]["status"] == 5) {%]
<a class="btn1 btn-warning automatic-locking" data-toggle="modal" data-id='[%= it[item]["id"] %]' data-status='[%= it[item]["status"] %]'>自动锁定</a>
[% } %]
<a class="btn1 btn-default btn-default-show-caozuo">>>></a>
[% if(check_auth('index/updateRole')) {%]
<a href="#modal-user" class="btn1 btn-danger btn-default-hide-display" id='role' href="#modal-edit" data-toggle="modal" data-id='[%= it[item]["id"] %]'>角色设置</a>
......
......@@ -28,6 +28,8 @@
<td>[%= it[item]['store_name'] %]</td>
<td>[%= swopen(it[item]['is_open']) %]</td>
<td>[%= swred(it[item]['is_dividend'])%]</td>
<td>[%= it[item]['income_time'] %]</td>
<td>
<a class="btn1 btn-info record-pic" href="#modal_financial" data-recordid="[%= it[item]['id'] %]" data-toggle="modal">资料</a>
<a class="btn1 btn-info add-pic" href="#modal-addPic" data-recordid="[%= it[item]['id'] %]" data-toggle="modal">编辑</a>
......@@ -61,6 +63,7 @@
<td>[%= swopen(it[item]['is_open']) %]</td>
<td>[%= swred(it[item]['is_dividend'])%]</td>
<td>[%= it[item]['remark'] %]</td>
<td>[%= it[item]['income_time'] %]</td>
<td>
<a class="btn1 btn-info record-pic" href="#modal_financial" data-recordid="[%= it[item]['id'] %]" data-toggle="modal">资料</a>
<a class="btn1 btn-info add-pic" href="#modal-addPic" data-recordid="[%= it[item]['id'] %]" data-toggle="modal">编辑</a>
......@@ -91,6 +94,8 @@
<td>[%= it[item]['agent_name'] %]</td>
<td>[%= it[item]['store_name']%]</td>
<td>[%= it[item]['receipt_number'] %]</td>
<td>[%= it[item]['income_time'] %]</td>
<td>
<a class="btn1 btn-info record-pic" href="#modal_financial" data-recordid="[%= it[item]['id'] %]" data-toggle="modal">资料</a>
<a class="btn1 btn-info add-pic" href="#modal-addPic" data-recordid="[%= it[item]['id'] %]" data-toggle="modal">编辑</a>
......@@ -120,6 +125,8 @@
<td>[%= it[item]['agent_name'] %]</td>
<td>[%= it[item]['store_name'] %]</td>
<td>[%= it[item]['receipt_number'] %]</td>
<td>[%= it[item]['income_time'] %]</td>
<td>
<a class="btn1 btn-info record-pic" href="#modal_financial" data-recordid="[%= it[item]['id'] %]" data-toggle="modal">资料</a>
<a class="btn1 btn-info add-pic" href="#modal-addPic" data-recordid="[%= it[item]['id'] %]" data-toggle="modal">编辑</a>
......@@ -169,7 +176,11 @@
<td class="shenzhen">[%= it[item]['alipay'] %]</td>
<td class="shenzhen">[%= it[item]['tenpay'] %]</td>
<td class="shenzhen">[%= it[item]['bank_card'] %]</td>
<!--上海 杭州-->
<td class="shenzhen">[%= it[item]['bank_card_yun'] %]</td>
<td class="shenzhen">[%= it[item]['pos'] %]</td>
<td class="shenzhen">[%= it[item]['family_pay'] %]</td>
<!--上海-->
<td class="shanghai">[%= it[item]['alipay'] %]</td>
<td class="shanghai">[%= it[item]['alipay_2'] %]</td>
<td class="shanghai">[%= it[item]['tenpay'] %]</td>
......@@ -180,6 +191,24 @@
<td class="shanghai">[%= it[item]['cash'] %]</td>
<td class="shanghai">[%= it[item]['pos'] %]</td>
<td class="shanghai">[%= it[item]['other_bank'] %]</td>
<td class="shanghai">[%= it[item]['bank_card'] %]</td>
<td class="shanghai">[%= it[item]['bank_card_new'] %]</td>
<!--杭州-->
<td class="hangzhou">[%= it[item]['alipay'] %]</td>
<td class="hangzhou">[%= it[item]['alipay_2'] %]</td>
<td class="hangzhou">[%= it[item]['tenpay'] %]</td>
<td class="hangzhou">[%= it[item]['tenpay_2'] %]</td>
<td class="hangzhou">[%= it[item]['realty_pay'] %]</td>
<td class="hangzhou">[%= it[item]['family_pay']%]</td>
<td class="hangzhou">[%= it[item]['private_bank'] %]</td>
<td class="hangzhou">[%= it[item]['cash'] %]</td>
<td class="hangzhou">[%= it[item]['pos'] %]</td>
<td class="hangzhou">[%= it[item]['other_bank'] %]</td>
<td class="hangzhou">[%= it[item]['bank_card'] %]</td>
<td class="hangzhou">[%= it[item]['bank_card_lin'] %]</td>
<td>[%= it[item]['operation_name'] %]</td>
<td>[%= it[item]['update_time'] %]</td>
......
......@@ -8,7 +8,7 @@
<td>[%= hideTel(it[item]['user_phone']) %]</td>
<td>[%= it[item]['create_time'] %]</td>
<td>[%= it[item]['report_agent_name'] %]</td>
<td>[%= it[item]['internal_title'] %]</td>
<td>[%= it[item]['house_title'] %]</td>
<td>[%= it[item]['predict_see_time'] %]</td>
<td>
<a class="btn1 btn-success timeline" href="#modal-time" data-toggle="modal" data-id='[%= it[item]["order_id"] %]'>时间轴</a>
......
......@@ -2,6 +2,7 @@
[% if(it) { %]
[% for(var item in it){ %]
<tr class="text-center">
<td>[%= it[item]['order_id'] %]</td>
<td>[%= it[item]['user_name'] %]</td>
<td>[%= hideTel(it[item]['user_phone']) %]</td>
<td>[%= it[item]['create_time'] %]</td>
......
......@@ -14,8 +14,8 @@
<td>[%= it[item]['money'] %]</td>
<td>[%= it[item]['real_money'] %]</td>
<td>
[% if(it[item]['is_adjustment']){ %]
调整收款(调整ID:[%= it[item]['source_id'] %])
[% if(it[item]['source'] == 2){ %]
调整收款(调整ID:[%= it[item]['source_id'] %])
[% } else { %]
正常收款
[% } %]
......@@ -24,11 +24,11 @@
[% if(it[item]['is_refund'] != 1 && !it[item]['is_adjustment']){ %]
正常
[% } else if(it[item]['is_refund'] == 1 && it[item]['is_adjustment']){ %]
被调整+被退款 <a class="btn1 btn-success add-status" href="#modal-status" data-toggle="modal" data-id='[%= it[item]["id"] %]'>详情</a>
被调整+被退款 <a class="btn1 btn-success add-status" href="#modal-status" data-toggle="modal" data-id='[%= it[item]["id"] %]' data-orderId='[%= it[item]["order_id"] %]'>详情</a>
[% } else if ( it[item]['is_refund'] == 1 ) { %]
被退款 <a class="btn1 btn-success add-status" href="#modal-status" data-toggle="modal" data-id='[%= it[item]["id"] %]'>详情</a>
被退款 <a class="btn1 btn-success add-status" href="#modal-status" data-toggle="modal" data-id='[%= it[item]["id"] %]' data-orderId='[%= it[item]["order_id"] %]'>详情</a>
[% } else { %]
被调整 <a class="btn1 btn-success add-status" href="#modal-status" data-toggle="modal" data-id='[%= it[item]["id"] %]'>详情</a>
被调整 <a class="btn1 btn-success add-status" href="#modal-status" data-toggle="modal" data-id='[%= it[item]["id"] %]' data-orderId='[%= it[item]["order_id"] %]'>详情</a>
[% } %]
</td>
<!--<td>[%= it[item]['source_id'] %]</td>-->
......
<script id="remark_follow_tpl" type="text/template">
[% var sw=function(s){switch(Number(s)){case 2:return"btn-info";case 1:return"btn-default"}}; %]
[% var user_info_obj = JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo')));%]
[% var delName=function(s){ delete s.user_name; delete s.user_nick;return s}; %]
[% if(it[0]) { %]
[% for(var item in it){ %]
......@@ -36,7 +37,7 @@
<td width="16%">
[% if((it[item]['agent_id']*1 == 0) || (check_auth('index/useraction_search'))) { %]
<a class="btn1 caozuo genj_ure caozuo-add-color [%= getLoaclRemarkId(it[item]['id']) %]" href="#modal-record" data-toggle="modal" data-phone='[%= it[item]["user_phone"] %]' data-id='[%= it[item]["user_id"] %]' data-agentId='[%= it[item]["agent_id"] %]' data-name='[%= it[item]["user_name"] %]' data-baohu='[%= it[item]["is_outstrip_twenty_four_hours"] %]' data-remark='[%= it[item]["id"] %]' data-vip='[%= it[item]["vip"] %]'>详情/跟进</a><p style="display: none;">[%= JSON.stringify(it[item]) %]</p>&nbsp;
<a class="btn1 caozuo genj_ure caozuo-add-color [%= getLoaclRemarkId(it[item]['id']) %]" href="#modal-record" data-toggle="modal" data-phone='[%= it[item]["user_phone"] %]' data-id='[%= it[item]["user_id"] %]' data-agentId='[%= it[item]["agent_id"] %]' data-name='[%= it[item]["user_name"] %]' data-baohu='[%= it[item]["is_outstrip_twenty_four_hours"] %]' data-remark='[%= it[item]["id"] %]' data-vip='[%= it[item]["vip"] %]'>详情/跟进</a><p style="display: none;">[%= JSON.stringify(delName(it[item])) %]</p>&nbsp;
[% if(it[item]['agent_id'] == it[item]['current_agent_id'] || check_auth('index/pcEditClient')) { %]
<a class="btn1 btn-success caozuo cao-zuo-record" href="#modal-record-edit" data-toggle="modal" data-phone='[%= it[item]["user_phone"] %]' data-id='[%= it[item]["user_id"] %]'>客户编辑</a>&nbsp;
......
......@@ -52,6 +52,11 @@
<div class="col-sm-8">
<input type="number" class="form-control btn5" name="agent_shop_num" placeholder="业务员最多可查看的商铺数量" value="[%= JSON.parse(it[item]['rule']).agent_shop_num %]">
</div>
[% } else if (it[item]['params'] == 'agent_suspend') { %]
<label class="col-sm-4 control-label" style="text-align: right">帐号自动冻结(客户跟进少于多少条):</label>
<div class="col-sm-8">
<input type="number" class="form-control btn5" name="agent_suspend" placeholder="帐号自动冻结,客户跟进数量" value="[%= JSON.parse(it[item]['rule']).agent_suspend %]">
</div>
[% } %]
[% } %]
</div>
......
<script id="user_list_tpl" type="text/template">
[% var sw=function(s){switch(Number(s)){case 2:return"btn-info";case 1:return"btn-default"}}; %]
[% var sw3=function(s){switch(Number(s)){case 0:return"btn-info";case 1:return"btn-info";case -1:return"btn-default"}}; %]
[% var delName=function(s){ delete s.user_name; delete s.user_nick;return s}; %]
[% if(it[0]) { %] [% for(var item in it){ %]
<tr class="text-center">
......@@ -52,7 +53,7 @@
</td>
<td width="16%">
[% if((it[item]['agent_id']*1 == 0) || (check_auth('index/useraction_search'))) { %]
<a class="btn1 caozuo genj_ure caozuo-add-color [%= getLoaclId(it[item]['id']) %]" href="#modal-record" data-toggle="modal" data-phone='[%= it[item]["user_phone"] %]' data-id='[%= it[item]["id"] %]' data-baohu='[%= it[item]["is_outstrip_twenty_four_hours"] %]' data-agent='[%= it[item]["agent_id"] %]' data-vip='[%= it[item]["vip"] %]' data-current='[%= it[item]["current_agent_id"] %]'>详情/跟进</a><p style="display: none;">[%= JSON.stringify(it[item]) %]</p>&nbsp;
<a class="btn1 caozuo genj_ure caozuo-add-color [%= getLoaclId(it[item]['id']) %]" href="#modal-record" data-toggle="modal" data-phone='[%= it[item]["user_phone"] %]' data-id='[%= it[item]["id"] %]' data-baohu='[%= it[item]["is_outstrip_twenty_four_hours"] %]' data-agent='[%= it[item]["agent_id"] %]' data-vip='[%= it[item]["vip"] %]' data-current='[%= it[item]["current_agent_id"] %]'>详情/跟进</a><p style="display: none;">[%= JSON.stringify(delName(it[item])) %]</p>&nbsp;
<a class="btn1 is_show [%= sw(it[item]['is_collect']) %]" data-id='[%= it[item]["id"] %]' data-cid='[%= it[item]["is_collect"] %]' data-baohu='[%= it[item]["is_outstrip_twenty_four_hours"] %]' data-agent='[%= it[item]["agent_id"] %]'>
[% if(it[item]["is_collect"] == 2) { %]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment