20], [['area_code'], 'string', 'max' => 10], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => 'ID', 'mall_id' => 'Mall ID', 'status' => 'Status', 'created_at' => 'Created At', 'updated_at' => 'Updated At', 'user_id' => 'User ID', 'send_at' => 'Send At', 'content' => 'Content', 'res' => 'Res', 'mobile' => 'Mobile', ]; } /** * @param int $mall_id * @param int $user_id * @param string $gateway * @param string $area_code * @param string $mobile * @param int $send_at * @param array $content * @return true * @throws \Exception */ public static function setData(int $mall_id, int $user_id, string $gateway, string $area_code, string $mobile, int $send_at, array $content) { $model = new self(); $model->mall_id = $mall_id; $model->user_id = $user_id; $model->mobile = $mobile; $model->send_at = $send_at; $model->content = $content; $model->gateway = $gateway; $model->area_code = $area_code; if (!$model->save()) throw new \Exception($model->getErrorMessage()); return true; } }