Commit c24f9788 authored by zw's avatar zw

Merge branch '1130-v3.0.1' into test

parents 8fee9d04 f8c00dda
......@@ -151,8 +151,8 @@ class Broker extends Basic
'update_time' => $date,
];
}
$resutl = $evaluate_sign->saveAll($sign_data);
foreach ($resutl as $vv) {
$result = $evaluate_sign->saveAll($sign_data);
foreach ($result as $vv) {
$id_arr[] = $vv->id;
}
}
......
<?php
/**
* Created by PhpStorm.
* User: hu jun
* Date: 2018/11/30
* Time: 14:58
*/
namespace app\api\service;
use app\api\untils\GeTuiUtils;
use app\model\AAgents;
use app\model\ChatUser;
use app\model\ChatUserExt;
use app\model\OPushMessageModel;
use app\model\OrderModel;
use app\model\OReportModel;
class PushClientService
{
private $m_push;
public function __construct()
{
$this->m_push = new OPushMessageModel();
}
/**
* @param int $report_id
* @param int $order_id
* @param int $type
* @param $message
* @param int $operation_id
* @return bool
*/
public function record(int $report_id, int $order_id, int $type, $message,int $operation_id)
{
$order = new OrderModel();
$house_id = $order->getFieldValue('house_id', ['id'=>$order_id]);
$report = new OReportModel();
$user_id = $report->getFieldValue('user_id', $report_id);
if (empty($message)) {
$m_agent = new AAgents();
$name = $m_agent->getAgentsById(58, 'name');
$message = '同联商业邀请您评价经纪人'.$name.'对商铺的带看服务';
}
$data['message'] = $message;
$data['order_id'] = $order_id;
$data['house_id'] = $house_id;
$data['user_id'] = $user_id;
return $this->m_push->addData($data, $operation_id, $type);
}
/**
* 消息推送
*/
public function pushRecord()
{
$title = $type = '';
$field = 'id,addressee_id,type,message,house_id,user_id,order_id';
$where['status'] = $id = $is_forbidden = 0;
$push_data = $this->m_push->getDateLimit($field, $where, 100);
foreach ($push_data['data'] as $k => $v) {
switch ($v['type']) {
case 0 :
$title = "评价经纪人";
$id = $v['house_id'];
$type = 'evaluate';
break;
}
$this->pushAgentAllDeviceId($v['addressee_id'], $title, $v['message'], $type, $id, $is_forbidden,$v['house_id'], $v['order_id']);
$update_data['status'] = 1;
$update_data['send_time'] = date('Y-m-d H:i:s');
$this->m_push->updateData($update_data, [ 'id' => $v['id'] ]);
}
return ;
}
/**
* @param $id
* @param $title
* @param $content
* @param int $type
* @param int $user_id
* @param int $is_forbidden
* @param int $house_id
* @param int $order_id
* @return array|bool
* @throws \Exception
*/
public function pushAgentAllDeviceId($id, $title, $content, $type = 0, $user_id = 0, $is_forbidden = 0, $house_id = 0, $order_id = 0)
{
if (empty($id)) {
return false;
}
$push = new GeTuiUtils('client');
$chat = new ChatUser();
$chat_ext = new ChatUserExt();
$ext_id = $chat->getFieldValue('id', ['uesr_id'=>$user_id, 'type'=>2]);
$push_id = $chat_ext->getInfo('push_id', ['ext_id'=>$ext_id, 'is_forbidden'=>$is_forbidden]);
$result = $push->public_push_message_for_one($user_id, $push_id['push_id'], $title, $content, $type, $user_id, $house_id, $order_id);
return $result;
}
}
\ No newline at end of file
......@@ -8,14 +8,11 @@
namespace app\api\untils;
use think\Loader;
define ('TL_GETUI_APPID','A8raBWQxuX9bcVmk3rkWa5');
define ('TL_GETUI_APPSECRET','TLNDlz8YsW6J4gexzb4AX3');
define ('TL_GETUI_APPKEY','dEC3iu81ZC9XbsVLwoiHA6');
define ('TL_GETUI_MASTERSECRET','3NNdfsgjCJ6Rmfr9l0EeI1');
define ('TL_GETUI_HOST','http://sdk.open.api.igexin.com/apiex.htm');
//define ('TL_GETUI_APPID','A8raBWQxuX9bcVmk3rkWa5');
//define ('TL_GETUI_APPSECRET','TLNDlz8YsW6J4gexzb4AX3');
//define ('TL_GETUI_APPKEY','dEC3iu81ZC9XbsVLwoiHA6');
//define ('TL_GETUI_MASTERSECRET','3NNdfsgjCJ6Rmfr9l0EeI1');
//define ('TL_GETUI_HOST','http://sdk.open.api.igexin.com/apiex.htm');
//define ('TL_GETUI_APPID','Cp63kT0yXMAmxVmekIQVI5');
//define ('TL_GETUI_APPSECRET','6BW6MJoIiK70mC3rJ1nK47');
......@@ -23,29 +20,54 @@ define ('TL_GETUI_HOST','http://sdk.open.api.igexin.com/apiex.htm');
//define ('TL_GETUI_MASTERSECRET','02DunI3DGL60rXkud74YZ8');
//define ('TL_GETUI_HOST','http://sdk.open.api.igexin.com/apiex.htm');
class GeTuiUntils {
class GeTuiUtils {
public function __construct()
const IGT_HOST = 'http://sdk.open.api.igexin.com/apiex.htm';
private $igt_app_id = '';
private $igt_app_secret = '';
private $igt_app_key = '';
private $igt_app_master_secret = '';
public function __construct($user_type)
{
include_once(EXTEND_PATH.'GETUI_PHP_SDK'.DS.'IGt.Push.php');
$this->setting($user_type);
}
/**
* @param $is 1经纪人
*/
public function setting($is)
{
if ($is == 'broker') {
$this->igt_app_id = 'A8raBWQxuX9bcVmk3rkWa5';
$this->igt_app_secret = 'TLNDlz8YsW6J4gexzb4AX3';
$this->igt_app_key = 'dEC3iu81ZC9XbsVLwoiHA6';
$this->igt_app_master_secret = '3NNdfsgjCJ6Rmfr9l0EeI1';
} else {
$this->igt_app_id = '1GnogURb3Y8cjQjmRtxXcA';
$this->igt_app_secret = 'qgCUSOcEQi52vRKQe6MYp8';
$this->igt_app_key = 'oQuYepflY8A7r0yGK9f9D4';
$this->igt_app_master_secret = 'numYAK4xpq8TEZHvaqeAT6';
}
}
/**
* 个推
*
* @param $touchuan
* @param $black_title
* @param $content
* @param $data
* @return array
* @throws \Exception
*/
function push_message_for_one($data)
{
$cid = $data['device_id'];
$igt = new \IGeTui(TL_GETUI_HOST, TL_GETUI_APPKEY, TL_GETUI_MASTERSECRET);
$igt = new \IGeTui(self::IGT_HOST, $this->igt_app_key, $this->igt_app_master_secret);
//模板
$template = $this->onli_all_template($data['touchuan'], $data['black_title'],$data['content']);
$template = $this->online_all_template($data['touchuan'], $data['black_title'],$data['content']);
//个推信息体
$message = new \IGtSingleMessage();
......@@ -55,28 +77,31 @@ class GeTuiUntils {
$message->set_PushNetWorkType(0);//设置是否根据WIFI推送消息,1为wifi推送,0为不限制推送
//接收方
$target = new \IGtTarget();
$target->set_appId(TL_GETUI_APPID);
$target->set_appId($this->igt_app_id);
$target->set_clientId($cid);
try {
$rep = $igt->pushMessageToSingle($message, $target);
} catch (RequestException $e) {
$requstId = $e . getRequestId();
$rep = $igt->pushMessageToSingle($message, $target, $requstId);
} catch (\RequestException $e) {
$requestId = $e->getRequestId();
$rep = $igt->pushMessageToSingle($message, $target, $requestId);
}
return $rep;
}
/**
* 群推
* zhuwei
* 2017-11-06
*
* @param $title
* @param $content
* @param $link
* @return mixed|null
* @throws \Exception
*/
function push_message_for_all($title,$content,$link)
{
$igt = new \IGeTui(TL_GETUI_HOST, TL_GETUI_APPKEY, TL_GETUI_MASTERSECRET);
$homeurl = $this->http_host();
$igt = new \IGeTui(self::IGT_HOST, $this->igt_app_key, $this->igt_app_master_secret);
$home_url = $this->http_host();
$data['black_title'] = $title;
$data['content'] = $content;
$data['touchuan'] = json_encode(array(
......@@ -86,9 +111,9 @@ class GeTuiUntils {
'url' => $link,
'name' => $title,
'id' => '69',
'imageUrl' => $homeurl .'/notice_android_logo.png'));
'imageUrl' => $home_url .'/notice_android_logo.png'));
$template = $this->onli_all_template($data['touchuan'], $data['black_title'], $data['content']);
$template = $this->online_all_template($data['touchuan'], $data['black_title'], $data['content']);
//个推信息体
//基于应用消息体
......@@ -98,7 +123,7 @@ class GeTuiUntils {
$message->set_data($template);
$message->set_PushNetWorkType(0);//设置是否根据WIFI推送消息,1为wifi推送,0为不限制推送
//$message->set_speed(1);// 设置群推接口的推送速度,单位为条/秒,例如填写100,则为100条/秒。仅对指定应用群推接口有效。
$appIdList = array(TL_GETUI_APPID);
$appIdList = array($this->igt_app_id);
$message->set_appIdList($appIdList);
$rep = $igt->pushMessageToApp($message);
return $rep;
......@@ -106,29 +131,33 @@ class GeTuiUntils {
/**
* 推送模板
* zhuwei
* 2017-11-06
*
* @param $touchuan
* @param $black_title
* @param $content
* @return \IGtTransmissionTemplate
* @throws \Exception
*/
function onli_all_template($touchuan, $black_title, $content)
function online_all_template($touchuan, $black_title, $content)
{
$template = new \IGtTransmissionTemplate();
$template->set_appId(TL_GETUI_APPID);//应用appid
$template->set_appkey(TL_GETUI_APPKEY);//应用appkey
$template->set_appId($this->igt_app_id);//应用appid
$template->set_appkey($this->igt_app_key);//应用appkey
$template->set_transmissionType(2);//透传消息类型
$template->set_transmissionContent($touchuan); //透传内容
//APN高级推送
$apn = new \IGtAPNPayload();
$alertmsg = new \DictionaryAlertMsg();
$alertmsg->body = $content;//对应的是在线透传的content
$alertmsg->actionLocKey = "打开同联商业";//滑动打开app
$alertmsg->locKey = $content;//锁屏提示下框
$alertmsg->title = $black_title;//标题 锁屏标题
$alertmsg->titleLocKey = $black_title;//下拉通知上部框框
$alertmsg->titleLocArgs = array("TitleLocArg");
$apn->alertMsg = $alertmsg;
$alert_msg = new \DictionaryAlertMsg();
$alert_msg->body = $content;//对应的是在线透传的content
$alert_msg->actionLocKey = "打开同联商业";//滑动打开app
$alert_msg->locKey = $content;//锁屏提示下框
$alert_msg->title = $black_title;//标题 锁屏标题
$alert_msg->titleLocKey = $black_title;//下拉通知上部框框
$alert_msg->titleLocArgs = array("TitleLocArg");
$apn->alertMsg = $alert_msg;
$apn->badge = 1;//应用icon上显示的数字
$apn->sound = "";
$template->set_apnInfo($apn);
......@@ -147,6 +176,7 @@ class GeTuiUntils {
* @param $house_id
* @param $order_id
* @return array
* @throws \Exception
*/
function public_push_message_for_one($id, $device_id, $title, $content, $type = 'other', $user_id, $house_id, $order_id)
{
......@@ -190,7 +220,7 @@ class GeTuiUntils {
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($curl);
if (curl_errno($curl)) {
return 'Errno' . curl_error($curl);
return 'ErrNo' . curl_error($curl);
}
curl_close($curl);
return $result;
......
......@@ -2,11 +2,13 @@
namespace app\api_broker\controller;
use app\api\service\PushClientService;
use app\api_broker\extend\Basic;
use app\api_broker\service\HouseNumUpdateService;
use app\api_broker\service\OrderLogService;
use app\api_broker\service\PushMessageService;
use app\api_broker\service\VerifyRepetitionService;
use app\api_broker\service\VipService;
use app\extra\RedisExt;
use app\model\AAgents;
use app\model\OBargainModel;
......@@ -128,6 +130,10 @@ class OrderLog extends Basic
$pushMarchIn = new PushMessageService();
$pushMarchIn->pushMarchInMessage($params["report_id"], 1, $params["report_id"]); //推送
//评价经纪人
$push_client = new PushClientService();
$push_client->record((int)$params["report_id"], (int)$params["order_id"], 0, '', (int)$this->agentId);
return $this->response("200", "request success", []);
} else {
return $this->response("101", "request faild");
......@@ -509,20 +515,39 @@ class OrderLog extends Basic
*/
public function searchOrder()
{
$params = $this->params;
/* $params = array(
"type" => 1, //0.客户电话 1.客户姓名,去掉 2.报备人电话 3.报备人姓名 4.商铺名称 5.商铺地址 6客户编号 7商铺编号
"agent_id" => 4022,
"search_keyword" => "程"
);*/
$params = $this->params;
/* $params = array(
"type" => 6, //0.客户电话 1.客户姓名,去掉 2.报备人电话 3.报备人姓名 4.商铺名称 5.商铺地址 6客户编号 7商铺编号
"agent_id" => 4022,
"is_all" => 1,//0自己的,1全部
"search_keyword" => "123",
"page_no"=>1,
"page_size"=>15
);*/
if (!isset($params["type"]) || !isset($params["agent_id"]) || empty($params["search_keyword"])) {
return $this->response("101", "请求参数错误");
}
if(($params["type"] == 6 || $params["type"] == 7) && !preg_match("/^\d*$/",$params["search_keyword"])){
return $this->response("101", "客户编号或商铺编号错误");
}
$pageNo = empty($params['page_no']) ? 1 : $params['page_no'];
$pageSize = empty($params['page_size']) ? 15 : $params['page_size'];
try {
$result = $this->service_->getSearchOrder($params);
$result = [];
if(isset($params["is_all"]) && $params["is_all"] == 1){
$vip = new VipService();
$check = $vip->vip($this->agentId, 'index/inspectionRecordAll');
if ($check) {
return $this->response(101, "暂无权限");
}
$result = $this->service_->getSearchOrderByAll($params,$pageNo,$pageSize);
}else{
$result = $this->service_->getSearchOrder($params,$pageNo,$pageSize);
}
if (count($result) > 0) {
return $this->response("200", "request success", $result);
} else {
......
......@@ -5,6 +5,7 @@ namespace app\api_broker\controller;
use app\api_broker\extend\Basic;
use app\api_broker\service\PushMessageService;
use app\api_broker\service\ReportService;
use app\api_broker\service\VipService;
use app\index\service\UserService;
use app\model\AAgents;
use app\model\FollowUpLogModel;
......@@ -107,13 +108,15 @@ class Report extends Basic
*/
public function reportList()
{
/* $params = array(
"agent_id" =>10013,
"type" => 1,//1表示全部 2表示进场 3 表示收款 4成交报告
"page_no"=>1,
"page_size"=>15
);*/
$params = $this->params;
/* $params = array(
"agent_id" =>10013,
"type" => 1,//1表示全部 2表示进场 3 表示收款 4成交报告
"is_all"=>1,//0搜索我自己的,1全部
"page_no"=>1,
"page_size"=>15
);*/
if (!isset($params["agent_id"]) || !isset($params["type"])) {
return $this->response("101", "请求参数错误");
......@@ -125,8 +128,18 @@ class Report extends Basic
$field = "a.id,a.user_id,a.user_phone,a.user_name,a.predict_see_time,a.create_time,b.id as order_id,b.order_no,b.house_id,b.house_title";
$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) {
return $this->response(101, "暂无权限");
}
$result = $this->service_->orderListAll($field, $params, $pageNo, $pageSize);
}else{
$result = $this->service_->orderList($field, $params, $pageNo, $pageSize);
}
$result = $this->service_->orderList($field, $params, $pageNo, $pageSize);
if (count($result) > 0) {
return $this->response("200", "request success", $result);
......
......@@ -16,6 +16,7 @@ use app\model\GHousesExt;
use app\model\GHousesFollowUp;
use app\model\GHousesImgs;
use app\model\GHousesToAgents;
use app\model\GImageDepot;
use app\model\GLandlordPhone;
use app\model\OBargainModel;
use app\model\OReportModel;
......@@ -497,7 +498,7 @@ class Shop extends Basic
$field .= ',b.age_limit,b.payment_month,b.deposit_month,b.external_slotting_fee,c.agents_id, b.area_width,b.depth,
b.electric_quantity,b.voltage,b.exhaust_fume,b.running_water,b.downriver,b.business_scope,b.decoration,b.source
,b.rim_mating,b.section,b.crowd,b.other,a.is_lock,b.project_name,a.is_vip,a.fit_industry_type';
,b.rim_mating,b.section,b.crowd,b.other,a.is_lock,b.project_name,a.is_vip,a.fit_industry_type,a.is_show_image,a.external_image_id';
$result = $this->gHousesModel->getHouseDetailById($field, $conditions);
if (count($result) <= 0) {
return $this->response("101", '此楼盘不存在');
......@@ -640,6 +641,16 @@ 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']}年";
if ($result['is_show_image'] == 1) {
$result['external_image'] = empty($result['images'][0]) ? "" : CK_IMG_URL . 'images/'.$result['images'][0]['img_name'];
} else {
$m_image_depot = new GImageDepot();
$image_id = explode(',', $result['external_image_id']);
$external_image = $m_image_depot->getInfo('img_name', ['id'=>$image_id[0], 'img_status'=>0]);
$result['external_image'] = empty($external_image['img_name']) ? "" : SHOP_IMAGE_DEPOT_URL.$external_image['img_name'];
}
unset($result['external_image_id']);
return $this->response("200", 'request success', $result);
}
......
......@@ -2,16 +2,12 @@
namespace app\api_broker\service;
use app\api\untils\GeTuiUntils;
use app\model\AAgents;
use app\model\FollowUpLogModel;
use app\model\GHousesFollowUp;
use app\model\GHousesToAgents;
use app\model\OBargainModel;
use app\model\OFinancialAudit;
use app\model\OImg;
use app\model\OMarchInModel;
use app\model\OPartialCommission;
use app\model\OPayLogModel;
use app\model\OrderModel;
use app\model\ORealIncome;
......@@ -21,7 +17,6 @@ use app\model\OTaxes;
use app\model\Regions;
use app\model\UPhoneFollowPp;
use app\model\Users;
use think\helper\Arr;
/**
......@@ -936,11 +931,16 @@ class OrderLogService
return $result;
}
/**
* @param $params 1.客户姓名 2.报备人电话 3.报备人姓名 4.商铺名称 5.商铺地址
* @return array|false|\PDOStatement|string|\think\Collection
* @param $params 0.客户电话 1.客户姓名,去掉 2.报备人电话 3.报备人姓名 4.商铺名称 5.商铺地址 6客户编号 7商铺编号
* @param $pageNo
* @param $pageSize
* @return mixed
* @throws \think\db\exception\BindParamException
* @throws \think\exception\PDOException
*/
public function getSearchOrder($params)
public function getSearchOrder($params,$pageNo,$pageSize)
{
$condition = $where_ = "1=1 ";
$field = "a.id,a.order_no,a.f_id,a.house_id,a.house_title,b.report_agent_id,b.report_agent_phone,b.report_agent_name,
......@@ -999,7 +999,76 @@ class OrderLogService
$orderModel = new OrderModel();
$result = $orderModel->searchOrder($field, $condition, $where_);
$result = $orderModel->searchOrder($field, $condition, $where_,$pageNo,$pageSize);
$ids_str = "";
if (count($result) <= 0) {
return null;
} else {
foreach ($result as $k => $v) {
$ids_str .= $v["id"] . ",";
}
$ids_str = rtrim($ids_str, ",");
$reportService = new ReportService();
$sign_arr = $reportService->orderSign($ids_str);
foreach ($result as $k => $v) {
foreach ($sign_arr as $value) {
if ($v["id"] == $value["order_id"]) {
$result[$k]["sign"] .= $reportService->signTitle($value["type"]) . ",";
}
}
}
return $result;
}
}
/**
* @param $params 1.客户姓名 2.报备人电话 3.报备人姓名 4.商铺名称 5.商铺地址
* @return mixed
* @throws \think\db\exception\BindParamException
* @throws \think\exception\PDOException
*/
public function getSearchOrderByAll($params,$pageNo,$pageSize)
{
$condition = $where_ = "1=1 ";
$field = "a.id,a.order_no,a.f_id,a.house_id,a.house_title,b.report_agent_id,b.report_agent_phone,b.report_agent_name,
b.user_id,b.user_phone,b.user_name,b.predict_see_time";
switch ((int)$params["type"]) {
case 0:
$condition .= "and b.user_phone like '%" . trim($params['search_keyword']) . "%' ";
break;
case 1:
$condition .= "and b.user_name like '%" . trim($params['search_keyword']) . "%' ";
break;
case 2:
$condition .= "and b.report_agent_phone like '%" . trim($params['search_keyword']) . "%' ";
break;
case 3:
$condition .= "and b.report_agent_name like '%" . trim($params['search_keyword']) . "%' ";
break;
case 4:
$condition .= "and a.house_title like '%" . trim($params['search_keyword']) . "%' ";
break;
case 5:
//todo 列表没有显示商铺地址 和产品沟通暂时搁置
//$condition["c.house_title"] = array( 'like', "%" . trim($params['search_keyword']) . "%" );
break;
case 6://客户编号
$condition .= "and b.user_id = " . trim($params['search_keyword']);
break;
case 7://商铺编号
$condition .= "and a.house_id = " . trim($params['search_keyword']);
break;
default:
return ["code" => "101", "msg" => "搜索类型错误"];
}
$orderModel = new OrderModel();
$result = $orderModel->searchOrderAll($field, $condition, $where_,$pageNo,$pageSize);
$ids_str = "";
if (count($result) <= 0) {
......
......@@ -9,7 +9,7 @@
namespace app\api_broker\service;
use app\api\untils\GeTuiUntils;
use app\api\untils\GeTuiUtils;
use app\model\AAgents;
use app\model\ABindingDevice;
use app\model\AStore;
......@@ -28,7 +28,7 @@ class PushMessageService
public function __construct()
{
$this->push = new GeTuiUntils();
$this->push = new GeTuiUtils('broker');
}
/**
......@@ -258,6 +258,7 @@ class PushMessageService
* @param int $house_id
* @param int $order_id
* @return array|bool
* @throws \Exception
*/
public function pushAgentAllDeviceId($id, $title, $content, $type = 0, $user_id = 0, $is_forbidden = 0, $house_id = 0, $order_id = 0)
{
......@@ -385,7 +386,6 @@ class PushMessageService
$m_push->updateData($update_data, [ 'id' => $v['id'] ]);
}
}
return ;
}
}
\ No newline at end of file
......@@ -2,7 +2,7 @@
namespace app\api_broker\service;
use app\api\untils\GeTuiUntils;
use app\api\untils\GeTuiUtils;
use app\model\GHouses;
use app\model\GHousesToAgents;
use app\model\OrderModel;
......@@ -30,14 +30,11 @@ class ReportService
$this->oReportModel = new OReportModel();
}
/**
* 验证用户信息
*
* @param $user_id
* @return array|null
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function verifyUser($user_id)
{
......@@ -155,6 +152,45 @@ class ReportService
return null;
}
/**
* 报备订单列表All
* @param $field
* @param $params
* @param $pageNo
* @param $pageSize
* @return mixed|null
* @throws \think\db\exception\BindParamException
* @throws \think\exception\PDOException
*/
public function orderListAll($field, $params, $pageNo, $pageSize)
{
$params = [];
$result = $this->oReportModel->selectReportList($field, $params, $pageNo, $pageSize);
$ids_str = "";
if (count($result) > 0) {
foreach ($result as $k => $v) {
//$result[$k]["user_phone"] = preg_replace('/(\d{3})\d{4}(\d{4})/', '$1****$2', $v["user_phone"]);
$ids_str .= $v["order_id"] . ",";
}
$ids_str = rtrim($ids_str, ",");
$sign_arr = $this->orderSign($ids_str);
foreach ($result as $k => $v) {
$result[$k]["sign"] = "";
foreach ($sign_arr as $value) {
if ($v["order_id"] == $value["order_id"]) {
$result[$k]["sign"] .= $this->signTitle($value["type"]) . ",";
}
}
}
return $result;
}
return null;
}
/**
* 报备订单列表
* @param $field
......
......@@ -107,6 +107,7 @@ class UploadFileService
$data["msg"][$k]['img_path'] = $date .'/'. $info->getSaveName(); //生成的图片路径
$data["msg"][$k]['internet_img_name'] = $internet_path . $data["msg"][$k]['img_path'];
$data["msg"][$k]['img_ext'] = $info->getExtension();
$data["msg"][$k]['imgformer_name'] = $file_info['basename'];
} else {
$data['code'] = 101;
$data["msg"][$k]['error'] = $_file->getError();
......@@ -123,6 +124,7 @@ class UploadFileService
$data["msg"]['img_path'] = $date .'/'. $info->getSaveName(); //生成的图片路径
$data["msg"]['internet_img_name'] = $internet_path . $data["msg"]['img_path'];
$data["msg"]['img_ext'] = $info->getExtension();
$data["msg"]['imgformer_name'] = $file_info['basename'];
} else {
$data['code'] = 101;
$data['msg'] = $_file->getError();
......
......@@ -10,7 +10,8 @@
<link rel="stylesheet" href="/app/css/common.css">
<link rel="stylesheet" href="/app/css/details.css">
<link rel="stylesheet" href="/app/css/lunbo.css">
<link rel="stylesheet" href="/app/css/details_tl.css?new01">
<!--<link rel="stylesheet" href="/app/css/details_tl.css?new01">-->
<link rel="stylesheet" href="/app/css/details_tl_tuiguang.css?new01">
<link>
</head>
......
......@@ -106,7 +106,8 @@ class News extends Basic
$m_file = new SFile();
$file_data = [];
foreach ($data['annex_file_name'] as $k=>$v) {
$file_data['file_name'] = $v;
$file_data['file_name'] = $v['file_name'];
$file_data['file_former_name'] = $v['file_former_name'];
$file_data['new_id'] = $id;
$file_data['type'] = 1;
$file_data['status'] = 0;
......@@ -198,4 +199,41 @@ class News extends Basic
$m_file->updateDateById($this->params['file_id'], ['status'=>1]);
return $this->response(200, '删除成功');
}
/**
* 附件下载并替换文件名
*
*/
public function downloadFile() {
// $this->params['file_id'] = 142;
if (!isset($this->params['file_id']) ) {
return $this->response(101, "Id is null.");
}
$field = 'id,file_name,file_former_name';
$where['status'] = 0;
$where['id'] = $this->params['file_id'];
$m_file = new SFile();
$data = $m_file->getFileById($field, $where);
if (!$data) {
return $this->response(101, "查无数据!");
}
$file_name = $data['file_name'];
$file_former_name = $data['file_former_name'];
$filepath = ROOT_PATH . 'public/static/business_school_file/'.$file_name;
if(file_exists($filepath)){
header("Content-type:application/octet-stream");
$filename = basename($filepath);
header("Content-Disposition:attachment;filename = {$file_former_name}");
header("Accept-ranges:bytes");
header("Accept-length:".filesize($filepath));
readfile($filepath);
}else{
echo "<script>alert('文件不存在')</script>";
}
}
}
\ No newline at end of file
......@@ -25,11 +25,14 @@ class RankingList extends Basic{
/**
* 查询分区业绩pk
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getRandKingList(){
$params = $this->params;
/* $params["position"] = 1;//职称 1店长 2经理 3主任 4顾问 0新人
$this->siteId = 10001;*/
/*$params["position"] = 1;//职称 1店长 2经理 3主任 4顾问 0新人
$this->siteId = 10002;*/
if(!isset($params["position"]) || $params["position"] < 0 || $params["position"] > 5){
return $this->response("101","请求参数错误");
}
......@@ -40,12 +43,14 @@ class RankingList extends Basic{
return $this->response("200", "request null");
}
/**
* 门店业绩pk
/**门店业绩pk
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getStoreRandKingList(){
$params = $this->params;
//$this->siteId = 10001;
$result = $this->service_->StoreRankingList( $this->siteId);
if(count($result) > 0){
......@@ -57,6 +62,9 @@ class RankingList extends Basic{
/**
* 导出分区pk榜
* @return string
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function exportReport(){
$params = $this->params;
......@@ -73,9 +81,11 @@ class RankingList extends Basic{
/**
* 导出门店pk榜
* @return string
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function exportReportStore(){
$params = $this->params;
/* $params["position"] = 1;
$this->siteId = 10001;*/
$export = new ExportExcelUntil();
......@@ -89,6 +99,9 @@ class RankingList extends Basic{
/**
* pk榜门店业绩和个人业绩排序显示前五
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function selectPkSortByTime()
{
......@@ -99,7 +112,7 @@ class RankingList extends Basic{
if (!isset($params["site_id"])) {
return $this->response("101", "请求参数错误");
}
$start_day = date('Y-m-01 00:00:00', strtotime('-1 month'));
$start_day = date('Y-m-01 00:00:00', strtotime('-3 month'));
$end_day = date("Y-m-d 23:59:59", strtotime(-date('d') . 'day'));
$list = $this->service_->totalAgent( $start_day, $end_day,$params["site_id"]);
......
......@@ -217,13 +217,21 @@ class Basic extends Controller
public function userVerify(){
$this->lastLoginTime = Session::get("lastLoginTime");
if(empty($this->userName) || empty($this->userId) || empty($this->lastLoginTime) ){
$this->redirect('/index/login');
if ($this->request->isAjax()) {
echo json_encode(array( "code" => "101", "msg" => "登录失效,请重新登录", "data" => [], "type" => "json" ));exit;
} else {
$this->redirect('/index/login');
}
}
$time = time();
//登录有效期为2小时
if (($time - $this->lastLoginTime) > 36000) {
$this->redirect('/index/login');
if ($this->request->isAjax()) {
echo json_encode(array( "code" => "101", "msg" => "登录失效,请重新登录", "data" => [], "type" => "json" ));exit;
} else {
$this->redirect('/index/login');die;
}
} else {
//更新时间
Session::set("lastLoginTime", $time);
......
......@@ -43,12 +43,22 @@ class BrokerService
*/
public function saveAgentData(array $data, int $operation_id)
{
$result['status'] = 'fail';
$is_new_id = 1;
$validate = new AAgentValidate();
$m_district = new ADistrict();
$data['site_id'] = $m_district->getDistrictKeyById('site_id', ['id' => $data['district_id']]);
$select_where['name'] = $data['name'];
$select_where['site_id'] = $data['site_id'];
$select_where['phone'] = ['<>', $data['phone']];
$check_id = $this->m_agent->getAgentsByWhere($select_where, 'id');
$result['status'] = 'fail';
if ($check_id) {
$result['msg'] = '同一城市出现同名,请修改。';
return $result;
}
if (empty($data['id'])) {
$check = $validate->scene('add')->check($data);
} else {
......@@ -86,7 +96,7 @@ class BrokerService
}
if ($status) {
$result['msg'] = '帐号存在离职或长假,请将需要转勤帐号转为正常。';
$result['msg'] = '该账号已存在,请将已经存在帐号转勤,离职或长假';
return $result;
}
......
......@@ -26,8 +26,14 @@ class RankingListService
{
$this->agentModel = new AAgents();
$this->agentTotalModel = new TAgentTotalModel();
$this->crewNum = 20;
$this->crewNumMax = 25;
$this->crewNum = array(
"10001"=>20,
"10002"=>8
);
$this->crewNumMax = array(
"10001" => 25,
"10002" => 13
);
}
......@@ -42,11 +48,7 @@ class RankingListService
*/
public function RankingList($position, $siteId)
{
//todo 1.查询出此职称的经纪人 获取10月份某个职称的排行 职称 1店长 2经理 3主任 4顾问 0新人
//todo 2.根据上月的业绩排行获取本月业绩排行,
//todo 3.根据此职称的总经纪人数分组
$begin_time = date('Y-m-01 00:00:00', strtotime('-1 month'));
$begin_time = date('Y-m-01 00:00:00', strtotime('-3 month'));
$end_time = date("Y-m-d 23:59:59", strtotime(-date('d') . 'day'));
$params["a.site_id"] = $siteId;
$params["a.position"] = $position;
......@@ -54,42 +56,11 @@ class RankingListService
$params['b.total_time'] = array('between', array($begin_time, $end_time));
$resultArr = $this->getSort($params, $begin_time, $end_time, "");
if (count($resultArr) <= 0) {
return false;
return null;
}
//分组
$total = count($resultArr);
$total_page = floor($total / $this->crewNum);
$residue = $total % $this->crewNum;
$full = $total_page * ($this->crewNumMax - $this->crewNum);
$x = $this->crewNum;
$y = $total_page;
if ($full < $residue) {
$y = $y + 1;
} else {
$x = ceil($residue / $total_page) + $this->crewNum;
}
$result = [];
$i = 0;
$k = 0;
foreach ($resultArr as $key => $item) {
$result[$i][$k++] = $item;
if ($y == $total_page) {
if (($k == $x - 1) && ($residue % $total_page) > 0 && ($i + 1) <= ($total_page - ($residue % $total_page))) {
$k = 0;
++$i;
} elseif ($k == $x) {
$k = 0;
++$i;
}
} else {
if ($k == $x) {
$k = 0;
++$i;
}
}
}
$result = $this->group($resultArr,$siteId);
//循环分组后的数组,查询出各组本月业绩排行
//本月
......@@ -116,38 +87,23 @@ class RankingListService
}
/**
* 门店业绩排行
* @param $resultArr
* @param $siteId
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function StoreRankingList($siteId){
$begin_time = date('Y-m-01 00:00:00', strtotime('-1 month'));
$end_time = date("Y-m-d 23:59:59", strtotime(-date('d') . 'day'));
$params["a.site_id"] = $siteId;
$params["a.status"] = 0;
$params['b.total_time'] = array('between', array($begin_time, $end_time));
$resultArr = $this->getStoreSort($params, $begin_time, $end_time, "");
if (count($resultArr) <= 0) {
return false;
}
private function group($resultArr,$siteId){
//分组
$total = count($resultArr);
$total_page = floor($total / $this->crewNum);
$residue = $total % $this->crewNum;
$full = $total_page * ($this->crewNumMax - $this->crewNum);
$x = $this->crewNum;
$total_page = floor($total / $this->crewNum[$siteId]);
$residue = $total % $this->crewNum[$siteId];
$full = $total_page * ($this->crewNumMax[$siteId] - $this->crewNum[$siteId]);
$x = $this->crewNum[$siteId];
$y = $total_page;
if ($full < $residue) {
$y = $y + 1;
} else {
$x = ceil($residue / $total_page) + $this->crewNum;
$x = ceil($residue / $total_page) + $this->crewNum[$siteId];
}
$result = [];
$i = 0;
$k = 0;
......@@ -169,6 +125,31 @@ class RankingListService
}
}
}
return $result;
}
/**
* 门店业绩排行
* @param $siteId
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function StoreRankingList($siteId){
$begin_time = date('Y-m-01 00:00:00', strtotime('-3 month'));
$end_time = date("Y-m-d 23:59:59", strtotime(-date('d') . 'day'));
$params["a.site_id"] = $siteId;
$params["a.status"] = 0;
$params['b.total_time'] = array('between', array($begin_time, $end_time));
$resultArr = $this->getStoreSort($params, $begin_time, $end_time, "");
if (count($resultArr) <= 0) {
return null;
}
//分组
$result = $this->group($resultArr,$siteId);
//循环分组后的数组,查询出各组本月业绩排行
//本月
......@@ -202,7 +183,7 @@ class RankingListService
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getStoreSort($params, $begin_time, $end_time, $ids)
private function getStoreSort($params, $begin_time, $end_time, $ids)
{
$storeModel = new AStore();
$fields = "a.id,a.store_name,SUM(b.performance) as performance";
......@@ -225,7 +206,7 @@ class RankingListService
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getSort($params, $begin_time, $end_time, $ids)
private function getSort($params, $begin_time, $end_time, $ids)
{
$fields = "a.id,c.store_name,a.name,a.phone,SUM(b.performance) as performance";
//查询出有业绩的经纪人
......@@ -265,7 +246,6 @@ class RankingListService
foreach ($store_sort as $key => $value) {
$store_arr = $this->agentModel->getStoreOrDistrict(["store_id" => $value["store_id"], "level" => ["in", "20"]]);
if (count($store_arr) > 0) {
//$value["name"] = count($store_arr) > 0 ? $store_arr[0]["name"] : "---";
$store_sort[$key]["img"] = $store_arr[0]["img"];
}
}
......
......@@ -106,8 +106,8 @@
<a class="btn btn-default btn-tab-60">店 长</a>
<a class="btn btn-default btn-tab-60">经 理</a>
<a class="btn btn-default btn-tab-60">主 任</a>
<a class="btn btn-default btn-tab-60">资深顾问</a>
<a class="btn btn-default btn-tab-60">顾 问</a>
<a class="btn btn-default btn-tab-60">新 人</a>
</td>
</tr>
<!--职称列表 搜索-->
......@@ -172,8 +172,8 @@
<option value="1">店长</option>
<option value="2">经理</option>
<option value="3">主任</option>
<option value="4">顾问</option>
<option value="0">新人</option>
<option value="4">资深顾问</option>
<option value="0">顾问</option>
</select>
</div>
<div class="form-group">
......@@ -220,8 +220,8 @@
<option value="1">店长</option>
<option value="2">经理</option>
<option value="3">主任</option>
<option value="4">顾问</option>
<option value="0">新人</option>
<option value="4">资深顾问</option>
<option value="0">顾问</option>
</select>
</div>
</form>
......
......@@ -83,6 +83,7 @@
<div class="clear">
</div>
<input class="form-control btn2" data-rule-phoneus="false" data-rule-required="false" id="bargain_id" placeholder="成交报告id" type="text" value="">
<div class="text-right">
<span class="btn btn-info btn3 search" id="maintable_search">搜索</span>
<span class="btn btn-info btn3" id="maintable_reset">重置</span>
......
......@@ -315,7 +315,7 @@
<button class="btn btn-default">选择附件</button>
</div>
<ul class="img-pre-ul" id="fujian_ul"></ul>
<p>点击文件名称即可下载</p>
<p class="text-danger">保存成功后,点击文件名称即可下载</p>
</div>
</div>
</div>
......
......@@ -106,8 +106,8 @@
<a class="btn btn-default btn-tab-60">店 长</a>
<a class="btn btn-default btn-tab-60">经 理</a>
<a class="btn btn-default btn-tab-60">主 任</a>
<a class="btn btn-default btn-tab-60">资深顾问</a>
<a class="btn btn-default btn-tab-60">顾 问</a>
<a class="btn btn-default btn-tab-60">新 人</a>
</td>
</tr>
<!--职称列表 搜索-->
......@@ -163,8 +163,8 @@
<option value="1">店长</option>
<option value="2">经理</option>
<option value="3">主任</option>
<option value="4">顾问</option>
<option value="0">新人</option>
<option value="4">资深顾问</option>
<option value="0">顾问</option>
</select>
</div>
<div class="form-group">
......@@ -211,8 +211,8 @@
<option value="1">店长</option>
<option value="2">经理</option>
<option value="3">主任</option>
<option value="4">顾问</option>
<option value="0">新人</option>
<option value="4">资深顾问</option>
<option value="0">顾问</option>
</select>
</div>
</form>
......
......@@ -248,8 +248,8 @@
<div>
<p>
<a id="fix_tel" href="javascript:;">
<img src="/app/images/icon_telephone@2x.png" class="tel-agent"/><br/>
<span>拨打电话</span>
<img src="/app/images/share_call_tel.gif" class="tel-agent"/>
<!--<span>拨打电话</span>-->
</a>
</p>
</div>
......
......@@ -431,7 +431,7 @@ class AAgents extends BaseModel
as aa left join
(select a.id,c.store_name,a.name,a.phone,0.00 as performance from a_agents a
left join t_agent_total b on a.id=b.agent_id left join a_store c on a.store_id=c.id
where b.total_time BETWEEN '$startTime' and '$endTime'and a.status in (0,3) $str_ids GROUP BY b.agent_id )
where a.site_id=$siteId and b.total_time BETWEEN '$startTime' and '$endTime'and a.status in (0,3) $str_ids GROUP BY b.agent_id )
as bb on aa.id = bb.id where bb.id is null" ;
$data = Db::table($this->table)->query($sql);
//echo $this->getLastSql();
......
......@@ -313,7 +313,7 @@ class AStore extends BaseModel
as aa left join
(select a.id,a.store_name,0.00 as performance from a_store a
left join t_agent_total b on a.id=b.store_id
where b.total_time BETWEEN '$startTime' and '$endTime'and a.status =0 $str_ids GROUP BY b.store_id )
where a.site_id=$siteId and b.total_time BETWEEN '$startTime' and '$endTime'and a.status =0 $str_ids GROUP BY b.store_id )
as bb on aa.id = bb.id where bb.id is null";
$data = Db::table($this->table)->query($sql);
//echo $this->getLastSql();
......
......@@ -77,4 +77,12 @@ class ChatUser extends Model
return $data;
}
/**
* @param $field
* @param $where
* @return mixed
*/
public function getFieldValue($field, $where) {
return $this->db->where($where)->value($field);
}
}
\ No newline at end of file
......@@ -177,4 +177,17 @@ class ChatUserExt extends BaseModel
}
return $num;
}
/**
* @param $field
* @param $where
* @param string $order
* @return mixed
*/
public function getInfo($field, $where, $order = 'ID DESC') {
return $this->db->field($field)
->where($where)
->order($order)
->find();
}
}
\ No newline at end of file
......@@ -108,4 +108,19 @@ class GImageDepot extends Model
//dump($this->getLastSql());
return $result;
}
/**
* @param string $field
* @param $params
* @return array|false|\PDOStatement|string|Model
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getInfo($field = 'id,img_name', $params) {
return Db::table($this->table)
->field($field)
->where($params)
->find($params);
}
}
<?php
/**
* Created by PhpStorm.
* User: hu jun
* Date: 2018/11/30
* Time: 15:01
*/
namespace app\model;
use think\Db;
class OPushMessageModel
{
protected $table = "u_push_message";
private $db_;
public function __construct()
{
$this->db_ = Db::name($this->table);
}
/**
* @param $data
* @param $operation_id
* @param $type
* @return bool
*/
public function addData($data, $operation_id, $type)
{
if (isset($data['house_id'])) {
$insert_data['house_id'] = $data['house_id'];
}
if (isset($data['message'])) {
$insert_data['message'] = $data['message'];
}
if (isset($data['remark'])) {
$insert_data['remark'] = $data['remark'];
}
if (isset($data['order_id'])) {
$insert_data['order_id'] = $data['order_id'];
}
if (isset($data['user_id'])) {
$insert_data['user_id'] = $data['user_id'];
}
$insert_data['status'] = 0;
$insert_data['type'] = $type;
$insert_data['operation_id'] = $operation_id;
$num = $this->db_->insert($insert_data);
if ($num > 0) {
$result = true;
} else {
$result = false;
}
return $result;
}
/**
* @param $data
* @param $where
* @return int|string
*/
public function updateData($data, $where) {
try {
$this->db_->where($where)->update($data);
$result['status'] = 'successful';
} catch (\Exception $e) {
$result['status'] = 'fail';
$result['msg'] = $e->getMessage();
}
return $result;
}
/**
* @param string $field
* @param array $params
* @param int $page_no
* @param int $page_size
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getListByWhere(string $field, array $params,int $page_no = 1,int $page_size = 15)
{
return $this->db_
->field($field)
->where($params)
->order(" id desc")
->page($page_no)
->limit($page_size)
->select();
}
/**
* 获取指定条数
*
* @param $field
* @param $where
* @param $limit
* @return mixed
*/
public function getDateLimit($field, $where, $limit)
{
try {
$result['data'] = $this->db_->field($field)
->where($where)
->limit($limit)
->select();
$result['status'] = 'successful';
} catch (\Exception $e) {
$result['status'] = 'fail';
$result['msg'] = $e->getMessage();
}
return $result;
}
}
\ No newline at end of file
......@@ -173,12 +173,15 @@ class OReportModel extends Model
*/
public function selectReportList($filed = "id", $params, $pageNo, $pageSize)
{
$report_agent_str = $house_str = "1=1 ";
$start_index = ($pageNo - 1) * $pageSize;
if (isset($params["report_agent_id"])) {
$report_agent_id = $params["report_agent_id"];
$report_agent_str = "a.report_agent_id IN ($report_agent_id )";
}
if (isset($params["house_ids"])) {
$house_ids = $params["house_ids"];
$house_str = "b.house_id IN ($house_ids)";
}
// 约带看时间 开始 结束
......@@ -226,7 +229,7 @@ class OReportModel extends Model
LEFT JOIN `o_order` `b` ON `a`.`id` = `b`.`f_id`
RIGHT JOIN `o_march_in` `c` ON `b`.`id` = `c`.`order_id`
WHERE
`a`.`report_agent_id` IN ($report_agent_id )
$report_agent_str
AND `a`.`status` = 0
AND `b`.`is_del` = 0
GROUP BY
......@@ -239,7 +242,7 @@ class OReportModel extends Model
LEFT JOIN `o_order` `b` ON `a`.`id` = `b`.`f_id`
RIGHT JOIN `o_march_in` `c` ON `b`.`id` = `c`.`order_id`
WHERE
`b`.`house_id` IN ($house_ids)
$house_str
AND `a`.`status` = 0
AND `b`.`is_del` = 0
GROUP BY
......@@ -259,7 +262,7 @@ class OReportModel extends Model
LEFT JOIN `o_order` `b` ON `a`.`id` = `b`.`f_id`
RIGHT JOIN `o_paylog` `c` ON `b`.`id` = `c`.`order_id`
WHERE
`a`.`report_agent_id` IN ($report_agent_id )
$report_agent_str
AND `a`.`status` = 0
AND `b`.`is_del` = 0
GROUP BY
......@@ -274,7 +277,7 @@ class OReportModel extends Model
LEFT JOIN `o_order` `b` ON `a`.`id` = `b`.`f_id`
RIGHT JOIN `o_paylog` `c` ON `b`.`id` = `c`.`order_id`
WHERE
`b`.`house_id` IN ($house_ids)
$house_str
AND `a`.`status` = 0
AND `b`.`is_del` = 0
GROUP BY
......@@ -294,7 +297,7 @@ class OReportModel extends Model
LEFT JOIN `o_order` `b` ON `a`.`id` = `b`.`f_id`
RIGHT JOIN `o_bargain` `c` ON `b`.`id` = `c`.`order_id`
WHERE
`a`.`report_agent_id` IN ($report_agent_id )
$report_agent_str
AND `a`.`status` = 0
AND `b`.`is_del` = 0
GROUP BY
......@@ -309,7 +312,7 @@ class OReportModel extends Model
LEFT JOIN `o_order` `b` ON `a`.`id` = `b`.`f_id`
RIGHT JOIN `o_bargain` `c` ON `b`.`id` = `c`.`order_id`
WHERE
`b`.`house_id` IN ($house_ids)
$house_str
AND `a`.`status` = 0
AND `b`.`is_del` = 0
GROUP BY
......@@ -326,7 +329,7 @@ class OReportModel extends Model
`o_report` `a`
LEFT JOIN `o_order` `b` ON `a`.`id` = `b`.`f_id`
WHERE
`a`.`report_agent_id` IN ($report_agent_id )
$report_agent_str
AND `a`.`status` = 0
AND `b`.`is_del` = 0)
UNION
......@@ -336,7 +339,7 @@ class OReportModel extends Model
`o_report` `a`
LEFT JOIN `o_order` `b` ON `a`.`id` = `b`.`f_id`
WHERE
`b`.`house_id` IN ($house_ids)
$house_str
AND `a`.`status` = 0
AND `b`.`is_del` = 0
) ) as aaa $where_params ORDER BY `create_time` DESC limit $start_index,$pageSize";
......@@ -965,4 +968,13 @@ class OReportModel extends Model
->group('a.report_agent_id ')
->find();
}
/**
* @param $field
* @param $where
* @return mixed
*/
public function getFieldValue($field, $where) {
return $this->db->where($where)->value($field);
}
}
\ No newline at end of file
......@@ -115,9 +115,9 @@ class OrderModel extends Model
* @throws \think\db\exception\BindParamException
* @throws \think\exception\PDOException
*/
public function searchOrder($field, $params, $where_)
public function searchOrder($field, $params, $where_,$pageNo,$pageSize)
{
$start_index = ($pageNo - 1) * $pageSize;
$sql = "SELECT * FROM
(
(
......@@ -139,13 +139,39 @@ class OrderModel extends Model
WHERE
$where_
)
) AS aaa order by aaa.id desc";
) AS aaa order by aaa.id desc LIMIT $start_index,$pageSize";
$result = $this->db_->query($sql);
//echo $this->getLastSql();
return $result;
}
/**
* @param $field
* @param $params
* @param $pageNo
* @param $pageSize
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function searchOrderAll($field, $params,$pageNo,$pageSize)
{
return $this
->field($field)
->alias("a")
->join("o_report b","a.f_id = b.id","left")
->where($params)
->order("id desc")
->page($pageNo)
->limit($pageSize)
->select();
}
/**
* @param $field
* @param $order_id
......
......@@ -76,4 +76,13 @@ class SFile extends BaseModel
->order($order)
->select();
}
public function getFileById($field = '', $params = '')
{
return $this
->field($field)
->where($params)
->find();
}
}
\ No newline at end of file
......@@ -87,7 +87,7 @@ class SNews extends BaseModel
->find();
$file = $this->db_->table('s_file')
->field('id as file_id,file_name')
->field('id as file_id,file_name,file_former_name')
->where('new_id',$params['id'])
->where('status',0)
->select();
......
......@@ -355,7 +355,7 @@ Route::group('index', [
//站点相关
'addSite' => ['index/Site/addSite', ['method' => 'POST|GET']], //获取站点列表 朱伟 2018-10-18
'getSiteList' => ['index/Site/getSiteList', ['method' => 'POST|GET']], //获取站点列表 朱伟 2018-10-18
'delImageDepot' => ['index/Site/delImageDepot', ['method' => 'POST|GET']], //关闭或开启站点 朱伟 2018-10-18
'delImageDepot_Site' => ['index/Site/delImageDepot', ['method' => 'POST|GET']], //关闭或开启站点 朱伟 2018-10-18
'inspectionRecordAll' => ['index/Report/inspectionRecordAll', ['method' => 'GET']], //全部约带看
'setSite' => ['index/auth/setSite', ['method' => 'GET|POST']], //设置角色站点
......@@ -370,6 +370,7 @@ Route::group('index', [
'getRecordsList' => ['index/broker/getRecordsList', ['method' => 'post|get']],//解绑或绑定经纪人设备id
'downloadFile' => ['index/news/downloadFile', ['method' => 'GET|POST']], //新增商学院资讯
]);
......@@ -493,12 +494,10 @@ Route::group('task', [
'queryRecordFile' => ['task/PrivacyNumber/queryRecordFile', ['method' => 'get']], //下载录音
'releaseNumber' => ['task/PrivacyNumber/releaseNumber', ['method' => 'get']], //释放号码
'checkBindPhone' => ['task/PrivacyNumber/checkBindPhone', ['method' => 'get']], //检查绑定关系,去除表中不存在的绑定关系
'totalAgentCall' => ['task/PrivacyNumber/totalAgentCall', ['method' => 'get']], //统计每天经纪人拨打电话
'oldTotalAgentCall' => ['task/PrivacyNumber/oldTotalAgentCall', ['method' => 'get']], //历史数据拨打数据
'updateStatusByTime' => ['task/updateShopStatusTask/updateStatusByTime', ['method' => 'get']], //修改上下架
'updateStatusByNum' => ['task/updateShopStatusTask/updateStatusByNum', ['method' => 'get']], //修改下架根据数量
'totalAgentCall' => ['task/PrivacyNumber/totalAgentCall', ['method' => 'get']], //统计每天经纪人拨打电话
'delBindPhone' => ['task/PrivacyNumber/delBindPhone', ['method' => 'get']], //处理经纪人号码用完释放
'updateStatusByTime' => ['task/updateShopStatusTask/updateStatusByTime', ['method' => 'get']], //修改上下架
'updateStatusByNum' => ['task/updateShopStatusTask/updateStatusByNum', ['method' => 'get']], //修改下架根据数量
'saveLookShop' => ['task/SaveLookShopHistoryTask/saveLookShop', ['method' => 'get']], //保存看铺记录
......@@ -523,6 +522,7 @@ Route::group('task', [
'updateShopAgeLimit' => ['task/JobTask/updateShopAgeLimit', ['method' => 'get']], //默认年限
'push' => ['task/PushMessageTask/push', ['method' => 'get']], //推送
'push' => ['task/PushMessageTask/pushClient', ['method' => 'get']], //推送
'updateLandlordLimit' => ['task/JobTask/updateLandlordLimit', ['method' => 'get']] //转换房东手机号
]);
......
......@@ -584,19 +584,35 @@ class PrivacyNumber
}
/**
* 历史数据
* 处理经纪人号码用完释放
*/
public function oldTotalAgentCall() {
$month = ['2018-03','2018-04','2018-05','2018-06','2018-07','2018-08','2018-09','2018-10','2018-11'];
// $month = ['2018-11'];
foreach ($month as $v) {
$firstday = date('Y-m-01', strtotime($v));
$lastday = date('d', strtotime("$firstday +1 month -1 day"));
public function delBindPhone() {
if (empty($_GET['phone_a']) || empty($_GET['start_time']) || empty($_GET['end_time'])) {
die('参数错误');
}
for ($i=1; $i<=$lastday; $i++) {
$this->totalAgentCall($v.'-'.$i);
$where['phone_a'] = $_GET['phone_a'];
$start_time = date('Y-m-d', strtotime($_GET['start_time']));
$end_time = date('Y-m-d', strtotime($_GET['end_time']));
$where['a.create_time'] = ['between', [$start_time .' 00:00:00', $end_time . ' 23:59:59']];
$data = $this->m_bind->getBindingPhoneList('a.phone_a,a.phone_b,b.phone_x,a.subsId', $where);
$key = 0;
foreach ($data['data'] as $k=>$v) {
$agent_where['phone'] = $v['phone_a'];
$agent_where['status'] = 0;
$agent_id = $this->m_agent->getAgentsByWhere($agent_where, 'id');
if (empty($agent_id)) {
$phone_where['phone'] = $v['phone_a'];
$phone_where['status'] = 0;
$agent_id = $this->m_agent_phone->getAgentsByWhere($phone_where, 'agents_id');
}
$call = new CallPhoneService();
$call->agentsUnBindRedis($v['phone_a'], $v['phone_b'], $v['phone_x'], 0, $agent_id);
$key++;
}
echo '释放:'.$key.'组';
return ;
}
}
\ No newline at end of file
......@@ -9,15 +9,24 @@
namespace app\task\controller;
use app\api\service\PushClientService;
use app\api_broker\service\PushMessageService;
class PushMessageTask
{
/**
* 定时推送
* 定时推送 (5分钟)
*/
public function push() {
$push = new PushMessageService();
$push->pushRecord();
}
/**
* 定时推送 (1分钟)
*/
public function pushClient() {
$push = new PushClientService();
$push->pushRecord();
}
}
\ No newline at end of file
......@@ -394,46 +394,49 @@
.fix_area_bottom_new>div{
width: 100%;
height: 1rem;
background: rgba(0,0,0,0.7);
/*background: rgba(0,0,0,0.7);*/
background: #FFFFFF;
box-shadow: 0 -4px 4px 0 #F8F9FB;
position: absolute;
bottom: 0;
left: 0;
font-size: 0.24rem;
color: white;
color: #000;
}
.fix_area_bottom_new>div>div:nth-of-type(1){
width: 64%;
width: 53%;
float: left;
}
.fix_area_bottom_new>div>div:nth-of-type(2){
float: left;
float: right;
margin-right: .3rem;
}
.fix_area_bottom_new>div>div:nth-of-type(1)>p{
margin-top: .18rem;
}
.fix_area_bottom_new>div>div:nth-of-type(2)>p{
margin-left: 1rem;
margin-top: .12rem;
/*margin-left: 1rem;*/
margin-top: .08rem;
text-align: center;
}
.head-img-agent{
height: .64rem;
width: .64rem;
border-radius: .32rem;
margin-left: .7rem;
margin-left: .3rem;
vertical-align: middle;
margin-top: -0.16rem;
}
.tel-agent{
height: .4rem;
width: .4rem;
width: 2.52rem;
height: .84rem;
}
body{
margin-bottom: 1.4rem;
}
.head-agent{
display: inline-block;
width: 3.3rem;
width: 2.5rem;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
......@@ -520,6 +523,9 @@ body{
float: right;
margin-right: .3rem;
}
#fix_tel{
display: inline-block;
}
.ul-agent-content-pc li{
overflow: hidden;
margin-bottom: .3rem;
......
.line_a{
width: 92%;
height: auto;
overflow: hidden;
margin: 0 auto;
}
.a_fonta{
font-size: 0.38rem;
color: #333333;
float: left;
font-weight: 900;
margin-top:0.4rem;
width: 100%;
}
.a_fontb{
font-size: 0.4rem;
color: #111;
float: left;
font-weight: 900;
margin-top:0.3rem;
width: 100%;
}
#font_24{
font-size: .24rem;
color: #4D4D4D;
}
.a_fontc{
background-image: url("../images/tonglian/di_wuye@2x.png");
background-size: 100% 0.6rem;
color: #ff9419;
font-size: 0.28rem;
text-indent: 0.26rem;
font-weight: 400;
float: left;
padding-right: 0.26rem;
line-height: 0.6rem;
margin-top: 0.3rem;
}
.a_fontd{
background-image: url("../images/tonglian/di_jinchang@2x.png");
background-size: 100% 0.6rem;
color: #ff9419;
font-size: 0.28rem;
text-indent: 0.26rem;
font-weight: 400;
float: left;
padding-right: 0.26rem;
line-height: 0.6rem;
margin-left: 0.3rem;
margin-top: 0.3rem;
}
.line_a_ul{
width: 100%;
}
.line_a_ulul{
margin-top: 0.15rem;
width: 92%;
}
.line_a_ul ul li{
width: 1.2rem;
height: .4rem;
font-size: 0.2rem;
color: #1A1A1A;
line-height: 0.4rem;
float: left;
margin-left: 0.3rem;
text-align: center;
margin-top: 0.15rem;
background-color: #F0F0F0;
}
.line_hr{
width: 92%;
height: 1px;
background: #E6E6E6;
margin-top: 0.4rem;
float: left;
margin-left: 3%;
}
.line_b{
width: 92%;
height: auto;
overflow: hidden;
}
.line_b ul li{
float: left;
}
.ul_b1{
width: 28%;
margin-left: 4%;
}
.ul_b3{
width: 28%;
margin-left: 4%;
}
.b1_span{
width: 100%;
font-size: 0.24rem;
color: #999;
text-align: center;
float: left;
margin-top: 0.4rem;
}
.b1_span_{
width: 100%;
font-size: 0.26rem;
color: #1A1A1A;
text-align: center;
float: left;
margin-top: 0.4rem;
}
.b1_span2{
color: #ff9419;
font-size: 0.4rem;
text-align: center;
margin-top: 0.3rem;
margin-left: 0.4rem;
}
/*.b1_span_totl{
color: #ff9419;
font-size: 0.4rem;
text-align: center;
width: 100%;
float: left;
}*/
.b1_span_totl{
color: #FF5C50;
font-size: 0.26rem;
text-align: center;
width: 100%;
float: left;
margin-top: .2rem;
}
.b1_span_totl_{
color: #1A1A1A;
font-size: 0.4rem;
text-align: center;
width: 100%;
float: left;
margin-top: .2rem;
}
.ul_b2{
width: 35%;
margin-left: 1%;
}
.b1_font{
color: #ff9419;
font-size: 0.28rem;
}
.b3_font1{
width: 92%;
font-size: 0.28rem;
color: #999999;
margin-left: 0.3rem;
float: left;
margin-top: 0.4rem;
}
.b3_font2{
width: 92%;
font-size: 0.28rem;
color: #999999;
margin-left: 0.3rem;
float: left;
margin-top: 0.3rem;
}
.gw{
color: #333333;
}
.b3_font3{
width: 15%;
font-size: 0.28rem;
color: #999999;
margin-left: 0.3rem;
float: left;
}
.b3_span3{
width: 78%;
/*float: left;*/
font-size: 0.28rem;
}
.dt{
margin-top: 0.3rem;
}
.b4_font{
width: 92%;
margin: 0 auto;
height: auto;
}
.b4_font .b4_font_p{
color: #333333;
font-size: 0.34rem;
width: 100%;
float: left;
font-weight: 900;
margin-top: 0.4rem;
}
.yw{
width: 100%;
font-size: 0.28rem;
color: #333333;
float: left;
margin-top: 0.3rem;
}
.b4_font2{
width: 100%;
font-size: 0.28rem;
color: #999999;
float: left;
margin-top: 0.3rem;
}
.zhaoshang-time-p, .kaiye-time-p{
display: none;
}
.b4_font3 {
width: 15%;
font-size: 0.28rem;
color: #999999;
/* margin-left: 0.3rem; */
float: left;
margin-top: 0.3rem;
}
.img_url{
width: 100%;
height: 3rem;
background: #fff5bd;
float: left;
margin-top: 0.4rem;
}
.but_right{
width: 0.13rem;
height: 0.23rem;
float: right;
margin-top: 0.13rem;
}
.lp{
margin-left: 0!important;
}
/*楼盘图*/
.bx-wrapper {
position: relative;
margin: 0 auto 60px;
padding: 0;
*zoom: 1;
}
.bx-wrapper img {
max-width: 100%;
display: block;
margin-top: 0.3rem;
}
.bx-wrapper .bx-pager,
.bx-wrapper .bx-controls-auto {
position: absolute;
bottom: -30px;
width: 100%;
display: none;
}
.bx-wrapper .bx-controls-direction a {
position: absolute;
top: 50%;
margin-top: -16px;
outline: 0;
width: 32px;
height: 32px;
text-indent: -9999px;
z-index: 9999;
}
.bx-wrapper .bx-controls-direction a.disabled {
display: none;
}
/* AUTO CONTROLS (START / STOP) */
.bx-wrapper .bx-controls-auto {
text-align: center;
}
.bx-wrapper .bx-controls-auto .bx-start:hover,
.bx-wrapper .bx-controls-auto .bx-start.active {
background-position: -86px 0;
}
.bx-wrapper .bx-controls-auto .bx-stop:hover,
.bx-wrapper .bx-controls-auto .bx-stop.active {
background-position: -86px -33px;
}
/* PAGER WITH AUTO-CONTROLS HYBRID LAYOUT */
.bx-wrapper .bx-controls.bx-has-controls-auto.bx-has-pager .bx-pager {
text-align: left;
width: 80%;
}
.bx-wrapper .bx-controls.bx-has-controls-auto.bx-has-pager .bx-controls-auto {
right: 0;
width: 35px;
}
/* IMAGE CAPTIONS */
.bx-wrapper .bx-caption {
position: absolute;
bottom: 0;
left: 0;
background: #666\9;
background: rgba(80, 80, 80, 0.75);
width: 100%;
}
.slide img{
width: 7.5rem;
height: 4rem;
float: left;
object-fit: contain;
}
.right{
float: right;
width: 47%;
}
.b3_span_shop_num{
display: none;
}
#planter{
margin-bottom: .3rem;
}
/*配套设施*/
.supporting-facilities{
width: 100%;
margin-bottom: 3.5rem;
}
.supporting-facilities>li{
float: left;
width: 20%;
margin-top: .32rem;
text-align: center;
}
.supporting-facilities>li span{
float: left;
width: 100%;
}
.supporting-facilities-img{
width: .4rem;
}
.icon-bg-facilities{
margin-bottom:.14rem ;
}
/*商铺详情 新的版本 样式更改*/
.b3_spanhao_font{
width: 92%;
font-size: 0.28rem;
color: #999999;
margin-left: 0.3rem;
float: left;
margin-top: .08rem;
}
.b3_spanhao_left{
float: right;
}
.b4_font_p_evaluation_first{
font-size: .28rem;
color: #333;
line-height: .56rem;
font-weight: 900;
}
.b4_font_p_evaluation{
font-size: .28rem;
color: #333;
margin-top: 0rem;
line-height: .56rem;
font-weight: 900;
}
.b4_font_evaluation{
color: #999999;
font-weight: 500;
}
.fix_area_bottom_new{
width: 100%;
position: fixed;
bottom: 0;
left: 0;
z-index: 9999;
display: none;
}
.fix_area_bottom_new>div{
width: 100%;
height: 1rem;
/*background: rgba(0,0,0,0.7);*/
background: #FFFFFF;
box-shadow: 0 -4px 4px 0 #F8F9FB;
position: absolute;
bottom: 0;
left: 0;
font-size: 0.24rem;
color: #000;
}
.fix_area_bottom_new>div>div:nth-of-type(1){
width: 48%;
float: left;
}
.fix_area_bottom_new>div>div:nth-of-type(2){
float: right;
margin-right: .3rem;
}
.fix_area_bottom_new>div>div:nth-of-type(1)>p{
margin-top: .18rem;
}
.fix_area_bottom_new>div>div:nth-of-type(2)>p{
margin-left: 1rem;
margin-top: .08rem;
text-align: center;
}
.head-img-agent{
height: .64rem;
width: .64rem;
border-radius: .32rem;
margin-left: .3rem;
vertical-align: middle;
margin-top: -0.16rem;
}
.tel-agent{
width: 2.52rem;
height: .84rem;
}
body{
margin-bottom: 1.4rem;
}
.head-agent{
display: inline-block;
width: 2.5rem;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
margin-top: 0.16rem;
}
/*商铺详情 动画*/
.shop-list{
position: fixed;
right: .2rem;
bottom: 2rem;
height: 2rem;
width: 1.64rem;
display: none;
background: url(/app/images/clik_shop_icon1.png) no-repeat 0 0/1.64rem 1.78rem;
}
.shop-list>img{
width: .8rem;
height: .88rem;
position: absolute;
animation: fly 1.5s infinite;
-webkit-animation: fly 1.5s infinite;
}
@keyframes fly {
0% {
bottom: 0;
right: -.1rem;
}
70% {
bottom: .3rem;
right: .14rem;
}
100% {
bottom: 0;
right: -.1rem;
}
}
@-webkit-keyframes fly {
0% {
bottom: 0;
right: -.1rem;
}
70% {
bottom: .3rem;
right: .14rem;
}
100% {
bottom: 0;
right: -.1rem;
}
}
/*.shop-list img{
width: 1.6rem;
}*/
.b3_span_shop_mianji{
display: none;
}
/*pc 官网css*/
.head-img-agent-pc {
height: .64rem;
width: .64rem;
border-radius: .32rem;
vertical-align: middle;
float: left;
}
.tel-img-agent-pc{
height: .5rem;
width: .5rem;
vertical-align: middle;
}
.agent-content-pc{
float: left;
margin-left: .16rem;
}
.agent-name-pc{
color: #333;
font-size: .28rem;
}
.agent-grade-pc{
color: #999;
font-size: .24rem;
}
#fix_tel_pc{
float: right;
margin-right: .3rem;
}
#fix_tel{
display: inline-block;
}
.ul-agent-content-pc li{
overflow: hidden;
margin-bottom: .3rem;
}
......@@ -44,6 +44,11 @@ define (['doT', 'text!temp/schoolBusiness_template_tpl.html','ckfinder','ckfinde
_doc.on('click', '.add-pic', function(){
follow.getaddPicList();
});
_doc.on('click', '.pdf-pre-a', function() {
var file_id = $(this).parent('li').attr('id') - 0 ;
var _url = '/index/downloadFile';
window.open(_url + '?file_id=' + file_id);
});
$("#search").click(function(){
user.getList(1);
});
......@@ -180,9 +185,11 @@ define (['doT', 'text!temp/schoolBusiness_template_tpl.html','ckfinder','ckfinde
for ( var i = 0 ; i < file_paths.length ; i++ ){
console.log(file_paths[i]['file_name'])
var _tempArr = file_paths[i]['file_name'].split('/');
file_paths[i]['file_name'] && $('#fujian_ul').append('<li class="pdf-pre-li" id='+file_paths[i]['file_id'] +'><a class="pdf-pre-a" download="{1}" href="{0}" title="点击可下载">{1}</a></li>'.stringFormatObj({
file_paths[i]['file_name'] && $('#fujian_ul').append('<li class="pdf-pre-li" id='+file_paths[i]['file_id'] +'><a class="pdf-pre-a" download="{1}" href="javascript:;" title="点击可下载">{2}</a></li>'.stringFormatObj({
'0': '/' + file_paths[i]['show_file'],
'1': dealFileName(decodeURI(_tempArr[_tempArr.length-1]))
'1': dealFileName(decodeURI(_tempArr[_tempArr.length-1])),
'2': file_paths[i]['file_former_name']
}));
}
}
......
......@@ -45,6 +45,15 @@ define(['doT', 'text!temp/schoolBusiness_template_tpl.html', 'ckfinder', 'ckfind
_doc.on('click', '.add-pic', function() {
follow.getaddPicList();
});
_doc.on('click', '.pdf-pre-a-download', function() {
var file_id = $(this).parent('li').attr('id') - 0 ;
var _url = '/index/downloadFile';
window.open(_url + '?file_id=' + file_id);
});
_doc.on('click', '.pdf-pre-a-new', function() {
alert('文件未保存 暂不能下载')
});
$("#search").click(function() {
user.getList(1);
});
......@@ -96,7 +105,7 @@ define(['doT', 'text!temp/schoolBusiness_template_tpl.html', 'ckfinder', 'ckfind
console.log(url);
if(_spFile == 'pdf') {
if(/(\.pdf|\.doc|\.xls)$/i.test(url)) {
_this.parent().next().prepend('<li class="pdf-pre-li"><a class="pdf-pre-a" download="{1}" href="{0}" title="点击可下载">{1}</a><a href="javascript:;" class="delet-pic-btn">删除</a></li>'.stringFormatObj({
_this.parent().next().prepend('<li class="pdf-pre-li"><a class="pdf-pre-a" download="{1}" href="javascript:;" title="点击可下载">{1}</a><a href="javascript:;" class="delet-pic-btn">删除</a></li>'.stringFormatObj({
'0': url,
'1': dealFileName(decodeURI(url.slice(url.lastIndexOf('/') + 1)))//dealFileName不要忘记
}));
......@@ -132,7 +141,7 @@ define(['doT', 'text!temp/schoolBusiness_template_tpl.html', 'ckfinder', 'ckfind
var formData = new FormData();
formData.append('type', 'business_school_file');
formData.append('image', _this[0].files[0]);
console.log(formData);
// formData.append('name', _this[0].files[0].name);
$.ajax({
type: 'post',
url: '/index/uploadImg',
......@@ -145,11 +154,12 @@ define(['doT', 'text!temp/schoolBusiness_template_tpl.html', 'ckfinder', 'ckfind
success: function(_data) {
if(_data.code == 200) {
var _url = _data.data.internet_img_name;
_this.parent().next().prepend('<li class="pdf-pre-li"><a data-filename="{3}" class="pdf-pre-a" href="javascript:;" title="保存之后才可以点击下载">{2}</a><a href="javascript:;" class="delet-pic-btn">删除</a></li>'.stringFormatObj({
_this.parent().next().prepend('<li class="pdf-pre-li"><a data-filename="{3}" class="pdf-pre-a pdf-pre-a-new" href="javascript:;" title="保存之后才可以点击下载">{4}</a><a href="javascript:;" class="delet-pic-btn">删除</a></li>'.stringFormatObj({
'0': _url,
'1': decodeURI(_url.slice(_url.lastIndexOf('/') + 1)),
'2': dealFileName(decodeURI(_url.slice(_url.lastIndexOf('/') + 1))),//dealFileName不要忘记
'3': _data.data.img_path
'3': _data.data.img_path,
'4': _data.data.imgformer_name
}));
} else {
alert(_data.msg);
......@@ -183,6 +193,7 @@ define(['doT', 'text!temp/schoolBusiness_template_tpl.html', 'ckfinder', 'ckfind
user.addDeleteNewsEvent(file_id);
};
});
//图片预览点击放大事件
_doc.on('click', '.img-pre-ul>li>img', function(e) {
_imgMaskObj.show().find('img').attr('src', this.src);
......@@ -221,6 +232,12 @@ define(['doT', 'text!temp/schoolBusiness_template_tpl.html', 'ckfinder', 'ckfind
}
});
},
//下载 pdf
// downloadPDF:function(){
// var _url = '/index/downloadFile'
// window.open(_url + 'file_id=' + excel);
// },
//点击编辑 调用的接口
text_details: function() {
var news_id = getUrlParam('id'); //地址栏获取的商铺或者街铺id
......@@ -256,9 +273,11 @@ define(['doT', 'text!temp/schoolBusiness_template_tpl.html', 'ckfinder', 'ckfind
for ( var i = 0 ; i < file_paths.length ; i++ ){
console.log(file_paths[i]['file_name'])
var _tempArr = file_paths[i]['file_name'].split('/');
file_paths[i]['file_name'] && $('#fujian_ul').append('<li class="pdf-pre-li" id='+file_paths[i]['file_id'] +'><a class="pdf-pre-a" download="{1}" href="{0}" title="点击可下载">{1}</a><a href="javascript:;" class="delet-pic-btn">删除</a></li>'.stringFormatObj({
file_paths[i]['file_name'] && $('#fujian_ul').append('<li class="pdf-pre-li" id='+file_paths[i]['file_id'] +'><a class="pdf-pre-a pdf-pre-a-download" download="{1}" href="javascript:;" title="点击可下载">{2}</a><a href="javascript:;" class="delet-pic-btn">删除</a></li>'.stringFormatObj({
'0': '/' + file_paths[i]['show_file'],
'1': dealFileName(decodeURI(_tempArr[_tempArr.length-1]))
'1': dealFileName(decodeURI(_tempArr[_tempArr.length-1])),
'2': file_paths[i]['file_former_name']
}));
}
} else {}
......@@ -330,7 +349,11 @@ define(['doT', 'text!temp/schoolBusiness_template_tpl.html', 'ckfinder', 'ckfind
if ( _fujianObj.length > 0 ){ //判断附件存在,同时,附件可能存在0到5个
for ( var i= 0 ; i < _fujianObj.length ; i++ ){
var one_name = _fujianObj[i].getAttribute('data-filename'); //附件取得是data-filename
_data['annex_file_name['+i+']'] = one_name;
var one_name_html = _fujianObj[i].innerHTML; //附件取得是data-filename
// _data['annex_file_name['+i+'][''']'] = one_name + ','+one_name_html;
// _data['annex_file_name['+i+'][1]'] = one_name_html;
_data['annex_file_name['+i+'][file_name]'] = one_name;
_data['annex_file_name['+i+'][file_former_name]'] = one_name_html;
}
}
/*if(_fujianObj.length === 1) {
......@@ -349,7 +372,6 @@ define(['doT', 'text!temp/schoolBusiness_template_tpl.html', 'ckfinder', 'ckfind
// user.getList(1);
alert('提交成功')
window.location.href = '/index/business_school';
console.log(66);
} else {
alert(data.msg);
}
......
......@@ -36,7 +36,7 @@ site={
}
$.ajax({//禁用
'type': 'POST',
'url' : '/index/delImageDepot',
'url' : '/index/delImageDepot_Site',
data: params,
dataType: "json",
success: function(data){
......
......@@ -218,7 +218,8 @@ define(['doT', 'text!temp/wait_backout_template_tpl.html', 'text!temp/reportList
'store_id' : $("select[name='store_id'] option:selected").val(),
'agent_name': $.trim($('#agent_name').val()),
'agent_phone': $.trim($('#agent_phone').val()),
'partial_id': bargain.agent_id_phone
'partial_id': bargain.agent_id_phone,
'bargain_id': $('#bargain_id').val()
};
$.ajax({
......
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