Commit 0c41945d authored by hujun's avatar hujun

时间轴-撤销成交报告修改

parent 60f1c7ac
<?php
/**
* Created by PhpStorm.
* User: hu jun
* Date: 2018/8/27
* Time: 17:24
*/
namespace app\model;
use think\Db;
class MPushMessage
{
protected $table = "o_bargain";
private $db_;
public function __construct()
{
$this->db_ = Db::name($this->table);
}
/**
* 根据楼盘id批量插入数据
*
* @param array $house_id 楼盘id
* @param int $operation_id 操作人id
* @param int $type 消息类型:0群推 1商铺下架 2修改客方 3盘方修改
* @param $data
* @return int|string
*/
public function addHouseIdArray(array $house_id, int $operation_id, int $type, $data)
{
if (is_array($house_id)) {
return false;
}
$insert_data = [];
foreach ($house_id as $k => $v) {
$insert_data[$k]['house_id'] = $v;
if (isset($data['message'])) {
$insert_data[$k]['message'] = $data['message'];
}
if (isset($data['user_id'])) {
$insert_data[$k]['user_id'] = $data['user_id'];
}
if (isset($data['addressee_id'])) {
$insert_data[$k]['addressee_id'] = $data['addressee_id'];
}
$insert_data[$k]['type'] = $type;
$insert_data[$k]['status'] = 0;
$insert_data[$k]['operation_id'] = $operation_id;
}
return $this->db_->insertAll($insert_data);
}
/**
* 根据经纪人id批量插入数据
*
* @param array $agent_id 楼盘id
* @param int $operation_id 操作人id
* @param int $type 消息类型:0群推 1商铺下架 2修改客方 3盘方修改
* @param $data
* @return int|string
*/
public function addAgentIdArray(array $agent_id, int $operation_id, int $type, $data)
{
if (is_array($agent_id)) {
return false;
}
$insert_data = [];
foreach ($agent_id as $k => $v) {
$insert_data[$k]['addressee_id'] = $v;
if (isset($data['message'])) {
$insert_data[$k]['message'] = $data['message'];
}
if (isset($data['user_id'])) {
$insert_data[$k]['user_id'] = $data['user_id'];
}
if (isset($data['house_id'])) {
$insert_data[$k]['house_id'] = $data['house_id'];
}
$insert_data[$k]['type'] = $type;
$insert_data[$k]['status'] = 0;
$insert_data[$k]['operation_id'] = $operation_id;
}
return $this->db_->insertAll($insert_data);
}
}
\ No newline at end of file
......@@ -41,11 +41,12 @@ class OFinancialAudit extends BaseModel
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getLastStep($bargain_id)
public function getLastStep($bargain_id, $source)
{
return $this->field('id,audit_level')->where([
'bargain_id' => $bargain_id,
'status' => 1,
'source' => $source,
'is_del' => 0
])->order('id desc')->find();
}
......@@ -85,8 +86,8 @@ class OFinancialAudit extends BaseModel
return false;
}
$this->startTrans();
$data['is_del'] = 1; //去除之前的审核记录
$this->editData($data, $bargain_id, 'bargain_id');
// $data['is_del'] = 1; //去除之前的审核记录
// $this->editData($data, $bargain_id, 'bargain_id');
$m_bargain = new OBargainModel();
$update_data['status'] = 20;
......@@ -122,6 +123,7 @@ class OFinancialAudit extends BaseModel
$where_["order_id"] = $params["order_id"];
}
$where_["is_del"] = 0;
$where_["source"] = 3;
$data = $this
->field($filed)
......
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