Commit 9e2f56fc authored by zw's avatar zw

shop status update

parent 3e0b4cc7
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
namespace app\task\controller; namespace app\task\controller;
use app\model\GHouses; use app\model\GHouses;
use app\model\SystemConfig;
/** /**
...@@ -24,12 +25,28 @@ class updateShopStatusTask ...@@ -24,12 +25,28 @@ class updateShopStatusTask
/** /**
* 每天2点跑一次 * 每天2点跑一次
* 根据创建时间和系统设置的时间范围内无动态则下架 * 根据创建时间和系统设置的时间范围内无动态则下架
* @return null
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/ */
public function updateStatusByTime() public function updateStatusByTime()
{ {
//todo 1.查询所有上架的店铺并且创建时间大于设置的自动下架的时间,并且动态无动态标签, 2.查询这些楼盘是否有动态 //todo 1.查询所有上架的店铺并且创建时间大于设置的自动下架的时间,并且动态无动态标签, 2.查询这些楼盘是否有动态
//todo 3.有动态的打上标签 4.过了时间并且没有动态的下架 //todo 3.有动态的打上标签 4.过了时间并且没有动态的下架
$day = 11; $this->updateStatusByPact();
$systemConfigModel = new SystemConfig();
$where["config_type"] = 10;
$data = $systemConfigModel->getSetting($where, "rule");
if ($data && $data["down_time"] > 0) {
$day = $data["down_time"];
}else{
return null;
}
$field = "a.id,b.id as order_id"; $field = "a.id,b.id as order_id";
$params = []; $params = [];
$time_ = date('Y-m-d', strtotime("-$day day")); $time_ = date('Y-m-d', strtotime("-$day day"));
...@@ -53,7 +70,7 @@ class updateShopStatusTask ...@@ -53,7 +70,7 @@ class updateShopStatusTask
$this->shopModel->updateHouse($update_arr); $this->shopModel->updateHouse($update_arr);
} }
$this->updateStatusByPact();
} }
/** /**
......
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