|
@@ -78,20 +78,15 @@ class SmmPostController extends AdminDistController
|
|
|
})
|
|
|
->options([ 0=>admin_trans_label('graphic'), 1=>admin_trans_label('videos')])->default(0)->required();
|
|
|
|
|
|
-
|
|
|
-
|
|
|
- //当前时间
|
|
|
- $now = Carbon::now()->format('Y-m-d H:i:s');
|
|
|
+ //用户当前时间
|
|
|
+ $now = utcToLocalTime(Carbon::now());
|
|
|
$form->datetime('send_time', admin_trans_label('send_time'))->placeholder(' ')->default($now)->required();
|
|
|
|
|
|
$rootAccounts = SmmUserAccount::getUserAccounts();
|
|
|
$listBoxOptions = [];
|
|
|
foreach ($rootAccounts as $account) {
|
|
|
- //查看发送次数是否超过限制
|
|
|
- // if (SmmPostLog::getPostQuota($account->getParent->name) > 0) {
|
|
|
//限额大于0才显示
|
|
|
$listBoxOptions[$account->id] = $account->name . ' ('.$account->getParent->name.')';
|
|
|
- // }
|
|
|
}
|
|
|
|
|
|
$form->checkbox('account_ids', admin_trans_label('accountsSelect'))->options($listBoxOptions)->required();
|
|
@@ -165,13 +160,14 @@ class SmmPostController extends AdminDistController
|
|
|
}
|
|
|
|
|
|
// 從北京時間字符串創建 Carbon 對象
|
|
|
- $sendTime = Carbon::createFromFormat('Y-m-d H:i:s', $post['send_time'], 'Asia/Shanghai');
|
|
|
-
|
|
|
- // 轉換為 UTC 時間
|
|
|
- $send_time = $sendTime->setTimezone('UTC');
|
|
|
+// $sendTime = Carbon::createFromFormat('Y-m-d H:i:s', $post['send_time'], 'Asia/Shanghai');
|
|
|
+//
|
|
|
+// // 轉換為 UTC 時間
|
|
|
+// $send_time = $sendTime->setTimezone('UTC');
|
|
|
+ $sendTime = localTimeToUtc($post['send_time']);
|
|
|
|
|
|
//保存数据
|
|
|
- SmmPost::create($post,$send_time,$image_video_url,getDistributorId());
|
|
|
+ SmmPost::create($post,$sendTime,$image_video_url,getDistributorId());
|
|
|
// 生成发送记录
|
|
|
$timer = new TimerSsmPost();
|
|
|
$timer->createLog();
|