try {
$apiCron = ApiCron::find()->where(['status' => 0])->orderBy(['date' => SORT_ASC])->one();
- $mess['line'][] = json_encode($apiCron, JSON_UNESCAPED_UNICODE);
- $mess['debug'] = [
- 'is_object' => is_object($apiCron),
- 'class' => get_class($apiCron),
- 'attributes' => $apiCron ? $apiCron->attributes : null,
- 'errors' => $apiCron ? $apiCron->errors : null
- ];
- if (!empty($apiCron)) {
+
+ if ($apiCron && $apiCron->id) {
$mess['line'][] = __LINE__;
$jsonId = $apiCron->request_id;
// $apiCron2 = ApiCron::find()->where(['id' => $apiCron->id])->andWhere(['request_id' => ''])->one();