'ID', 'mall_id' => 'Mall ID', 'user_id' => 'User ID', 'store_id' => 'store_id', 'date_time' => 'Date Time', 'is_all_day' => 'Is All Day', 'status' => 'Status', 'created_at' => 'Created At', 'updated_at' => 'Updated At', ]; } public function getSchedulingTime() { return $this->hasMany(StoreReserveTechnicianSchedulingTime::class, ['sid' => 'id'])->andWhere(['status' => [StatusEnum::ENABLED]])->select('id,start_time,end_time,sid'); } public static function setData($params) { try { if (!empty($params['id'])) { $model = self::find()->where(['id' => $params['id']])->one(); if (empty($model)) throw new \Exception('数据不存在'); } else { $model = new self(); } $model->loadDefaultValues(); if (!$model->load($params, '') || !$model->save()) throw new Exception($model->getErrorMessage()); return $model; } catch (\Exception $e) { self::$static_error = $e->getMessage(); return false; } } public static function getDataOne($params, $select = "*", $orderBy = 'id desc') { return self::find()->where($params)->select($select)->orderBy($orderBy)->asArray()->one(); } public static function getDataAll($params, $select = "*", $orderBy = 'id desc') { return self::find()->where($params)->select($select)->orderBy($orderBy)->asArray()->all(); } }