Commit f3ce19ef authored by hujun's avatar hujun

商铺跟进省市区转换

parent 473550dd
...@@ -7,18 +7,43 @@ ...@@ -7,18 +7,43 @@
*/ */
namespace app\index\controller; namespace app\index\controller;
use app\index\extend\Basic; use app\index\extend\Basic;
class HouseFollowUp extends Basic{ use app\model\GHouses;
//在controller里新增的php文件名 use app\model\GHousesFollowUp;
public function followUpList(){
//followUpList 方法 class HouseFollowUp extends Basic
if (!$this->request->isAjax()) { {
return view('houses/HouseFollowUp'); public function followUpList()
//找到view下的 houses 文件夹下的 HouseFollowUp的html 文件 {
if (!$this->request->isAjax()) {
return view('houses/HouseFollowUp');
} }
} }
/**
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function transformFollowUp()
{
$time = time();
$m_house = new GHouses();
$m_follow = new GHousesFollowUp();
$total = $m_follow->getTotal();
$page = ceil($total / 5000);
for ($i = 1; $i <= $page; $i++) {
$data = $m_house->getList($i, 5000, 'id asc', 'id,province,city,disc');
foreach ($data as $k => $v) {
$insert['province'] = $v['province'];
$insert['city'] = $v['city'];
$insert['disc'] = $v['disc'];
$m_follow->where('house_id', $v['id'])->update($insert);
}
}
echo time() - $time . '秒';
}
} }
\ No newline at end of file
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
namespace app\model; namespace app\model;
use think\Db; use think\Db;
use think\Model;
/** /**
* Created by PhpStorm. * Created by PhpStorm.
...@@ -12,7 +11,7 @@ use think\Model; ...@@ -12,7 +11,7 @@ use think\Model;
* Time : 下午4:31 * Time : 下午4:31
* Intro: * Intro:
*/ */
class GHousesFollowUp extends Model class GHousesFollowUp extends BaseModel
{ {
protected $table = "g_houses_follow_up"; protected $table = "g_houses_follow_up";
protected $db_; protected $db_;
...@@ -68,6 +67,9 @@ class GHousesFollowUp extends Model ...@@ -68,6 +67,9 @@ class GHousesFollowUp extends Model
* @param $field * @param $field
* @param $params * @param $params
* @return false|\PDOStatement|string|\think\Collection * @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/ */
public function getShopFollowUpList($field, $params) public function getShopFollowUpList($field, $params)
{ {
...@@ -84,7 +86,6 @@ class GHousesFollowUp extends Model ...@@ -84,7 +86,6 @@ class GHousesFollowUp extends Model
} }
/** /**
* 首页商铺跟进搜索
* @param int $p * @param int $p
* @param int $pageSize * @param int $pageSize
* @param string $order_ * @param string $order_
...@@ -93,6 +94,9 @@ class GHousesFollowUp extends Model ...@@ -93,6 +94,9 @@ class GHousesFollowUp extends Model
* @param $where * @param $where
* @param $group * @param $group
* @return false|\PDOStatement|string|\think\Collection * @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/ */
public function getSearch($p = 1, $pageSize = 15, $order_ = 'id desc', $field, $join, $where, $group) public function getSearch($p = 1, $pageSize = 15, $order_ = 'id desc', $field, $join, $where, $group)
{ {
...@@ -126,6 +130,13 @@ class GHousesFollowUp extends Model ...@@ -126,6 +130,13 @@ class GHousesFollowUp extends Model
return $data; return $data;
} }
/**
* @param array $params
* @return bool
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getFollowUpByHouseId(array $params): bool public function getFollowUpByHouseId(array $params): bool
{ {
$where_ = []; $where_ = [];
......
...@@ -280,6 +280,7 @@ Route::group('index', [ ...@@ -280,6 +280,7 @@ Route::group('index', [
'selectDistrictPerformance' => [ 'index/Performance/selectDistrictPerformance', [ 'method' => 'POST|GET' ] ], //区域业绩排行 朱伟 2018-07-31 'selectDistrictPerformance' => [ 'index/Performance/selectDistrictPerformance', [ 'method' => 'POST|GET' ] ], //区域业绩排行 朱伟 2018-07-31
'selectStorePerformance' => [ 'index/Performance/selectStorePerformance', [ 'method' => 'POST|GET' ] ], //门店业绩排行 朱伟 2018-07-31 'selectStorePerformance' => [ 'index/Performance/selectStorePerformance', [ 'method' => 'POST|GET' ] ], //门店业绩排行 朱伟 2018-07-31
'selectIndividualPerformance' => [ 'index/Performance/selectIndividualPerformance', [ 'method' => 'POST|GET' ] ], //个人业绩排行 朱伟 2018-07-31 'selectIndividualPerformance' => [ 'index/Performance/selectIndividualPerformance', [ 'method' => 'POST|GET' ] ], //个人业绩排行 朱伟 2018-07-31
'transformFollowUp' => [ 'index/HouseFollowUp/transformFollowUp', [ 'method' => 'GET' ] ], //个人业绩排行 朱伟 2018-07-31
......
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