Commit 449e6680 authored by 梅玉龙's avatar 梅玉龙

Merge branch '202305_remark' into release_preview

parents b5fb36a0 c332c448
......@@ -1358,6 +1358,8 @@ class Ajax extends MY_Controller {
public function banwords() {
$address = urldecode($this->input->get('address',TRUE));
$remark = urldecode($this->input->get('remark',TRUE));
$stand_remark = urldecode($this->input->get('stand_remark',TRUE));
$service_remark = urldecode($this->input->get('service_remark',TRUE));
$this->load->helper('common_house_helper');
$filename = STATIC_SOURCE_URL . '/common/banwords/banwords.txt';
$result = array('status' => 1);
......@@ -1365,6 +1367,10 @@ class Ajax extends MY_Controller {
$result['status'] = 2;
} else if (publish_banwordCheck($remark, $filename)) {
$result['status'] = 3;
} else if (publish_banwordCheck($stand_remark, $filename)) {
$result['status'] = 4;
} else if (publish_banwordCheck($service_remark, $filename)) {
$result['status'] = 5;
}
echo $this->ajax_model->array_to_json($result);
}
......
......@@ -34,6 +34,8 @@ class Editor extends MY_Controller
'hilitecolor', 'bold', 'italic', 'underline', 'removeformat', '|',
'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
'insertunorderedlist', '|', 'wordpaste', '|', 'image'";
// 编辑器id
$edit_config['edit_id'] = $this->input->get('id') ? $this->input->get('id') : 'remark';
$this->load->view('/editor', $edit_config);
}
......
......@@ -67,7 +67,10 @@ class Sell extends MY_Controller {
* @var int
*/
private $_total_count = 0;
const STAND_REMARK_DEFAULT = '请输入业主心态,可从卖房原因、卖房紧迫度,是否可议价等方面进行描述';
const SERVICE_REMARK_DEFAULT = '请输入服务优势,可从行业经验、服务内容等方面进行描述';
const DEFAULT_REMARK = '请输入房源核心优势,可从【小区】、【户型】、【核心卖点】、【周边配套】等方面进行描述';
/**
* 解析函数
......@@ -506,6 +509,7 @@ class Sell extends MY_Controller {
//360全景房源标签规则
$address = $this->input->post('address', true);
$remark = $this->input->post('remark');
$remark = $remark === self::DEFAULT_REMARK ? '' : $remark;
$p_sort_arr = $this->input->post('p_sort', true);
$is360 = 0;
......@@ -937,7 +941,7 @@ class Sell extends MY_Controller {
}
}
$fields_values['remark'] = check_word($this->input->post('remark'),STATIC_BADWORD_URL);
$fields_values['remark'] = check_word($remark,STATIC_BADWORD_URL);
//房源特色
$fields_values['feature'] = '';
$feature = $this->input->post('feature', true);
......@@ -996,7 +1000,17 @@ class Sell extends MY_Controller {
if ($house_id)
{
// 插入房源扩展信息
$standRemark = check_word($this->input->post('stand_remark'),STATIC_BADWORD_URL);
$standRemark = $standRemark === self::STAND_REMARK_DEFAULT ? '' : $standRemark;
$serviceRemark = check_word($this->input->post('service_remark'), STATIC_BADWORD_URL);
$serviceRemark = $serviceRemark === self::SERVICE_REMARK_DEFAULT ? '' : $serviceRemark;
$this->load->model('sell_ext');
$this->sell_ext->dataModel($house_id, array(
'uid' => $uid,
'stand_remark' => $standRemark,
'service_remark' => $serviceRemark,
));
//判断房源价格是否在预警价格区间,仅对住宅类做判断
/*if ($fields_values['blockid'] && $fields_values['infotype']==1){
$_sell = $fields_values;
......@@ -2253,7 +2267,11 @@ class Sell extends MY_Controller {
$data_page['is_show_real'] = $is_show_real;
$this->load->model('real_house_model');
$data_page['balance']= $this->real_house_model->getBrokerRealHouseMoney($uid);//经纪人账号余额
// 房源扩展信息
$this->load->model('sell_ext');
$sellExt = $this->sell_ext->getSellExt($id);
$data_page['house_detail']['stand_remark'] = isset($sellExt['stand_remark']) ? $sellExt['stand_remark'] : '';
$data_page['house_detail']['service_remark'] = isset($sellExt['service_remark']) ? $sellExt['service_remark'] : '';
$this->render_publish($data_page);
}
......@@ -2281,6 +2299,7 @@ class Sell extends MY_Controller {
//360全景房源标签规则
$address = $this->input->post('address', true);
$remark = $this->input->post('remark');
$remark = $remark === self::DEFAULT_REMARK ? '' : $remark;
$p_sort_arr = $this->input->post('p_sort', true);
$is360 = 0;
......@@ -2723,7 +2742,7 @@ class Sell extends MY_Controller {
}
//$fields_values['remark'] = $this->input->post('remark');
$fields_values['remark'] = check_word($this->input->post('remark'),STATIC_BADWORD_URL);
$fields_values['remark'] = check_word($remark,STATIC_BADWORD_URL);
//房源特色
$fields_values['feature'] = '';
......@@ -2999,7 +3018,16 @@ class Sell extends MY_Controller {
//更新房源信息
//update sell set esta = 5 where id in(33899521, 37700775) and uid = 10000040;
$affected_rows = $this->sell_model->update($fields_values, $house_id, $uid);
// 插入房源扩展信息
$standRemark = check_word($this->input->post('stand_remark'), STATIC_BADWORD_URL);
$standRemark = $standRemark === self::STAND_REMARK_DEFAULT ? '' : $standRemark;
$serviceRemark = check_word($this->input->post('service_remark'), STATIC_BADWORD_URL);
$serviceRemark = $serviceRemark === self::SERVICE_REMARK_DEFAULT ? '' : $serviceRemark;
$this->load->model('sell_ext');
$this->sell_ext->dataModel($house_id, array(
'stand_remark' => $standRemark,
'service_remark' => $serviceRemark,
));
//添加房源发布价格日志信息
$this->load->model('house_publish_rule_log_model');
$housePublishRuleLogData = $this->house_publish_rule_log_model->getRow($house_id,1,3,$uid);
......
<?php
/**
* Desc: 房源扩展信息
* User: mellon
* Date: 2023/5/11
* Time: 15:19
*/
class sell_ext extends MY_Model
{
public $table = 'sell_ext';
public function __construct()
{
parent::__construct(1, 1, 0);
}
/**
* 更新插入数据
* @param $houseId
* @param $data
* @author mellon
*/
public function dataModel($houseId, $data)
{
$standRemark = $data['stand_remark'] ? $data['stand_remark'] : '';
$serviceRemark = $data['service_remark'] ? $data['service_remark'] : '';
// 查询数据
$this->dbback->from($this->table)->where('house_id', $houseId);
$query = $this->dbback->get()->row();
if (!empty($query)) {
// 更新
$this->db->where('house_id', $houseId);
$this->db->update($this->table, array(
'stand_remark' => $standRemark,
'service_remark' => $serviceRemark,
));
} else {
// 插入
$insert_data['house_id'] = $houseId;
$insert_data['uid'] = $data['uid'] ? $data['uid'] : 0;
$insert_data['telno'] = $data['telno'] ? $data['telno'] : '';
$insert_data['create_time'] = date('Y-m-d H:i:s');
$insert_data['ip'] = get_ip();
$insert_data['stand_remark'] = $standRemark;
$insert_data['service_remark'] = $serviceRemark;
$this->db->insert($this->table, $insert_data);
}
}
/**
* 获取房源扩展信息
* @param $houseId
* @return mixed
* @author mellon
*/
public function getSellExt($houseId)
{
$this->dbback->from($this->table)->where('house_id', $houseId);
return $this->dbback->get()->row_array();
}
}
\ No newline at end of file
<?php
// 默认文字
switch ($edit_id) {
case 'stand_remark':
$defaultText = '请输入业主心态,可从卖房原因、卖房紧迫度,是否可议价等方面进行描述';
break;
case 'service_remark':
$defaultText = '请输入服务优势,可从行业经验、服务内容等方面进行描述';
break;
case 'remark':
default:
$defaultText = '请输入房源核心优势,可从【小区】、【户型】、【核心卖点】、【周边配套】等方面进行描述';
break;
}
?>
<html>
<head>
<style>
*{margin:0;padding:0;}
</style>
<script charset='utf-8' src='<?= STATIC_SOURCE_URL ?>/common/js/kindeditor-4.1.10/kindeditor-min.js'></script>
<script charset='gbk' src='<?= STATIC_SOURCE_URL ?>/common/js/kindeditor-4.1.10/lang/zh_CN.js'></script>
</head>
<body style="backgroud:none;">
<textarea name="remark" id="remark" cols="0" rows="0" style="width:835px;height:155px;display:none;"></textarea>
<script>
document.getElementById('remark').value = window.parent.document.getElementById('remark').value;
<head>
<style>
* {
margin: 0;
padding: 0;
}
</style>
<script charset='gbk' src='<?= STATIC_SOURCE_URL ?>/common/js/jquery-1.8.3.min.js'></script>
<script charset='utf-8' src='<?= STATIC_SOURCE_URL ?>/common/js/kindeditor-4.1.10/kindeditor-min.js'></script>
<script charset='gbk' src='<?= STATIC_SOURCE_URL ?>/common/js/kindeditor-4.1.10/lang/zh_CN.js'></script>
</head>
<body style="backgroud:none;">
<textarea name="remark" id="<?= $edit_id ?>" cols="0" rows="0"
style="width:835px;height:155px;display:none;"></textarea>
<script>
document.getElementById('<?=$edit_id?>').value = window.parent.document.getElementById('<?=$edit_id?>').value;
var currText = $("#<?=$edit_id?>", window.parent.document).val();
var editor;
var defaultText = '<?=$defaultText?>';
var editor;
KindEditor.ready(function(K) {
editor = K.create('#remark', {
width: '<?= $width ?>px',
height: '<?= $height ?>px',
resizeType: 0,
allowPreviewEmoticons: false,
allowImageUpload: false,
items: [<?=$items?>],
//下面这行代码,当失去焦点时执行 this.sync();
afterBlur: function() {
this.sync();
window.parent.document.getElementById('remark').value = document.getElementById('remark').value;
//$("#jsErrorBox").html("");
//$("#remark").blur();
/*if($("#remark").val()!='<p> &nbsp;</p>' && $("#remark").val()!='<br />')
{
alert("1")
$("#remark2").val($("#remark").val());
}else{
$("#remark2").val("");
}*/
}
});
});
</script>
</body>
// 默认赋值
$("#<?=$edit_id?>").val(currText);
KindEditor.ready(function (K) {
editor = K.create('#<?=$edit_id?>', {
width: '<?= $width ?>px',
height: '<?= $height ?>px',
resizeType: 0,
allowPreviewEmoticons: false,
allowImageUpload: false,
items: [<?=$items?>],
//下面这行代码,当失去焦点时执行 this.sync();
afterBlur: function () {
this.sync();
if (editor.html() === '') {
editor.html(defaultText);
$(".ke-edit-iframe").contents().find(".ke-content").css("color", "#777");
//document.getElementsByClassName('ke-content')[0].style.color = '#777';
//console.log(document.getElementsByClassName('ke-content'))
}
//window.parent.document.getElementById('<?=$edit_id?>').value = document.getElementById('<?=$edit_id?>').value;
window.parent.document.getElementById('<?=$edit_id?>').value = currText;
// 赋值到父元素
//$("#<?=$edit_id?>", window.parent.document).val = currText;
//$("#jsErrorBox").html("");
//$("#remark").blur();
/*if($("#remark").val()!='<p> &nbsp;</p>' && $("#remark").val()!='<br />')
{
alert("1")
$("#remark2").val($("#remark").val());
}else{
$("#remark2").val("");
}*/
},
afterFocus: function () {
if (editor.html() === defaultText) {
editor.html('');
$(".ke-edit-iframe").contents().find(".ke-content").css("color", "black");
}
},
afterCreate:function () {
//为编辑框赋值
setTimeout(function () {
var default_text = currText;
if(editor && default_text){
editor.html(default_text)
}
if(default_text === ''){
editor.html(defaultText);
$(".ke-edit-iframe").contents().find(".ke-content").css("color","#777");
}
},1000)
},
afterChange:function () {
if(editor){
this.sync();
currText = $.trim(editor.html());
//$("#<?=$edit_id?>", window.parent.document).val = currText;
//$("#<?=$edit_id?>", window.parent.document).css({"height":"333px;"});
window.parent.document.getElementById('<?=$edit_id?>').value = currText;
}
}
});
});
</script>
</body>
</html>
\ No newline at end of file
......@@ -576,6 +576,29 @@
<textarea name="remark" id="remark" cols="0" rows="0" style="margin-top:5px; width:835px; height:155px; display:none;"><?=$house_detail['remark']?></textarea>
<div class="editorBox" style="height: 400px;"> <iframe id="remark_iframe" frameborder="0" scrolling="no" src="/editor/house/" style="margin-top:5px; width:830px; height:400px;"></iframe></div>
</dd>
<dd class="list_item clearfix clear">
<label class="label">业主心态:</label>
<div class="fields ">
<p class="textFg textFg6">业主的想法是购房人非常关注的信息之一,请介绍业主的卖房相关内容</p>
</div>
</dd>
<dd class="list_item list_item02 clearfix clear">
<textarea name="stand_remark" id="stand_remark" cols="0" rows="0" style="margin-top:5px; width:835px; height:155px; display:none;"><?=$house_detail['stand_remark']?></textarea>
<div class="editorBox" style="height: 400px;"> <iframe id="stand_remark_iframe" frameborder="0" scrolling="no" src="/editor/house/?id=stand_remark" style="margin-top:5px; width:830px; height:400px;"></iframe></div>
</dd>
<dd class="list_item clearfix clear">
<label class="label">服务优势:</label>
<div class="fields ">
<p class="textFg textFg6">好的服务可以吸引用户咨询,请介绍公司的优质服务内容</p>
</div>
</dd>
<dd class="list_item list_item02 clearfix clear">
<textarea name="service_remark" id="service_remark" cols="0" rows="0" style="margin-top:5px; width:835px; height:155px; display:none;"><?=$house_detail['service_remark']?></textarea>
<div class="editorBox" style="height: 400px;"> <iframe id="service_remark_iframe" frameborder="0" scrolling="no" src="/editor/house/?id=service_remark" style="margin-top:5px; width:830px; height:400px;"></iframe></div>
</dd>
<dd>
<?php
if ($infotype == 1 || $infotype == 2 || $infotype == 3 || $infotype == 4) {
......
......@@ -1294,8 +1294,12 @@ $(function() {
$.ajax({
type: 'post',
url : '/ajax/banwords/',
data: {address:encodeURI(encodeURI($('#address').val())),
remark:encodeURI(encodeURI($('#remark').val()))},
data: {
address: encodeURI(encodeURI($('#address').val())),
remark: encodeURI(encodeURI($('#remark').val())),
stand_remark: encodeURI(encodeURI($('#stand_remark').val())),
service_remark: encodeURI(encodeURI($('#service_remark').val())),
},
dataType:'json',
success: function(data){
if(data.errorCode == '401')
......@@ -1313,6 +1317,16 @@ $(function() {
$('#remark').focus();
openWin('JS_noteHouse4');
return false;
} else if (data.status == 4) {
$('#banwords').html('您输入的业主心态描述中含有敏感词,请重新输入!');
$('#stand_remark').focus();
openWin('JS_noteHouse4');
return false;
} else if (data.status == 5) {
$('#banwords').html('您输入的服务优势描述中含有敏感词,请重新输入!');
$('#service_remark').focus();
openWin('JS_noteHouse4');
return false;
} else {
//均价不能小于小区价格的65%
if ($('#price').val() != '' && $('#buildarea').val() != ''
......
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