Commit e4222f6a authored by clone's avatar clone

数据转换

parent f39d740b
......@@ -67,7 +67,7 @@ class AppointmentTime extends Basic
return $this->response("101", "楼盘信息不能为空");
}
//todo 参数校验
if (!isset($params["phone"]) || !preg_match('/1[345678]\d{9}/', $params["phone"])) {
if (!isset($params["phone"]) || !preg_match('/^1[345678]\d{9}$/', $params["phone"])) {
return $this->response("101", "手机号为空或手机号无效");
}
......
This diff is collapsed.
......@@ -26,23 +26,25 @@ class Applies extends Model
public function getApplies($pageNo, $pageSize, $field)
{
$where_["transaction_status"] = 1;
return Db::table($this->table)
->field($field)
->alias("a")
->join('houseinfos b', 'a.house_id = b.id', 'LEFT')
->join('agents c', 'a.agent_id = c.id', 'LEFT')
->where($where_)
->limit($pageSize)
->page($pageNo)
->select();
}
public function getAppliesCount()
{
$where_["transaction_status"] = 1;
return $this
->field("a.id")
->alias("a")
->join('houseinfos b', 'a.house_id = b.id', 'LEFT')
->where($where_)
->count();
}
......
......@@ -42,6 +42,23 @@ class OMarchInModel extends Model
}
}
/**
* 新增跟进信息 批量
* @param $params
* @return int
*/
public function addMarchInAll($params)
{
Db::startTrans();
try {
$this->db_model->insertAll($params);
Db::commit();
return 1;
} catch (\Exception $e) {
Db::rollback();
return 0;
}
}
/**
* @param $filed
* @param $params
......
......@@ -2,10 +2,21 @@
namespace app\model;
use Think\Db;
use think\Model;
class RefundTables extends Model
{
// 设置当前模型对应的完整数据表名称
protected $table = 'refundtables';
public function getRefundList($field)
{
return Db::table($this->table)
->field($field)
->alias("a")
->join('o_report b', 'a.apply_id = b.id', 'LEFT')
->join('o_order c', 'b.id = c.f_id', 'LEFT')
->select();
}
}
......@@ -6,7 +6,7 @@ use think\Model;
use think\Db;
class Remarks extends Model
{
protected $table = "remarks";
/**
* 成交记录列表
*
......@@ -125,4 +125,31 @@ class Remarks extends Model
/****************************处理客户电话****************************************/
return $data;
}
public function getRemarksList($pageNo, $pageSize, $field)
{
$where_["a.isinstatus"] = 1;
return Db::table($this->table)
->field($field)
->alias("a")
->join('o_report b', 'a.apply_id = b.id', 'LEFT')
->join('o_order c', 'b.id = c.f_id', 'LEFT')
->join('remarksimgs d', 'a.id = d.remarks_id', 'LEFT')
->where($where_)
->limit($pageSize)
->page($pageNo)
->select();
}
public function getRemarksCount()
{
$where_["a.isinstatus"] = 1;
return Db::table($this->table)
->field("a.id")
->alias("a")
->join('o_report b', 'a.apply_id = b.id', 'LEFT')
->join('o_order c', 'b.id = c.f_id', 'LEFT')
->join('remarksimgs d', 'a.id = d.remarks_id', 'LEFT')
->where($where_)
->count();
}
}
......@@ -376,10 +376,11 @@ class Users extends Model
*/
public function insertUserConvert($params){
$where_ = [];
if(isset($params["user_phone"])){
$where_ ["user_phone"] = $params ["user_phone"];
if(!isset($params["user_phone"]) || !preg_match('/^1[345678]\d{9}$/', $params["user_phone"])){
return null;
}
$model = Db::table($this->table);
$where_ ["user_phone"] = $params ["user_phone"];
$model = Db::name($this->table);
$list = $model
->field("id,user_name,user_phone")
......
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