Commit 97aa3d85 authored by hujun's avatar hujun

随机图片

parent aedbfe92
...@@ -444,6 +444,7 @@ Route::group('task', [ ...@@ -444,6 +444,7 @@ Route::group('task', [
'updateShopTask' => [ 'task/JobTask/updateShopTask', [ 'method' => 'post | get' ] ], //默认跟进 'updateShopTask' => [ 'task/JobTask/updateShopTask', [ 'method' => 'post | get' ] ], //默认跟进
'updateShopImageIdTask' => [ 'task/JobTask/updateShopImageIdTask', [ 'method' => 'post | get' ] ], //默认图片
'push' => [ 'task/PushMessageTask/push', [ 'method' => 'get' ] ] //推送 'push' => [ 'task/PushMessageTask/push', [ 'method' => 'get' ] ] //推送
]); ]);
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
namespace app\task\controller; namespace app\task\controller;
use app\index\service\ImageDepotService;
use app\model\GHouses; use app\model\GHouses;
/** /**
...@@ -58,5 +59,27 @@ class JobTask ...@@ -58,5 +59,27 @@ class JobTask
} }
public function updateShopImageIdTask()
{
set_time_limit(0); // 取消脚本运行时间的超时上限
$image = new ImageDepotService();
$field = "id,industry_type,update_time";
$params = [];
$total = $this->gHouseModel->getHouseListTotal($params);
$pageSize = 200;
$pageTotal = ceil($total / $pageSize);
for ($pageNo = 1; $pageNo <= $pageTotal; $pageNo++) {
$houseList = $this->gHouseModel->getShopList($field, $params, $pageNo, $pageSize);
$houseArr = [];
foreach ($houseList as $item) {
$industry_type = explode(',', $item['industry_type']);
$houseBin['external_image_id'] = $image->getImage($industry_type[0]);
$houseBin["id"] = $item["id"];
$houseBin["update_time"] = $item["update_time"];
array_push($houseArr, $houseBin);
}
$this->gHouseModel->updateHouse($houseArr);
}
}
} }
\ No newline at end of file
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