|
@@ -18,7 +18,7 @@ class SyncPlan extends Command
|
|
|
{
|
|
{
|
|
|
try {
|
|
try {
|
|
|
|
|
|
|
|
- $output->writeln("开始更新快递信息====>" . getDateFull());
|
|
|
|
|
|
|
+ $output->writeln("开始更计划带货数据信息====>" . getDateFull());
|
|
|
$nextPage = 1;
|
|
$nextPage = 1;
|
|
|
while (is_numeric($nextPage)) {
|
|
while (is_numeric($nextPage)) {
|
|
|
$resp = (new SaasLivePlan)->where(["status" => 1])->page($nextPage, 10)->select();
|
|
$resp = (new SaasLivePlan)->where(["status" => 1])->page($nextPage, 10)->select();
|
|
@@ -33,7 +33,15 @@ class SyncPlan extends Command
|
|
|
"appid" => sConf("wechat.mini_appid"),
|
|
"appid" => sConf("wechat.mini_appid"),
|
|
|
"secret" => sConf("wechat.mini_secret"),
|
|
"secret" => sConf("wechat.mini_secret"),
|
|
|
])->token()->getPlanData([intval($item['plan_id'])]);
|
|
])->token()->getPlanData([intval($item['plan_id'])]);
|
|
|
- print_r($planData);
|
|
|
|
|
|
|
+ if (isset($planData['data'][$item['plan_id']])) {
|
|
|
|
|
+ echo getDateFull()."更新数据成功\n";
|
|
|
|
|
+ (new SaasLivePlan)->where("id",$item['id'])->save([
|
|
|
|
|
+ "order_money" => $planData['data'][$item['plan_id']]['gmv']??0,
|
|
|
|
|
+ "done_money" => $planData['data'][$item['plan_id']]['used_gmv']??0
|
|
|
|
|
+ ]);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ echo getDateFull()."没有查询到数据\n";
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
$nextPage = $nextPage+1;
|
|
$nextPage = $nextPage+1;
|
|
|
$output->writeln("进入下一页=={$nextPage}==".getDateFull());
|
|
$output->writeln("进入下一页=={$nextPage}==".getDateFull());
|