本文整理汇总了PHP中skeeks\cms\shop\Module::className方法的典型用法代码示例。如果您正苦于以下问题:PHP Module::className方法的具体用法?PHP Module::className怎么用?PHP Module::className使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类skeeks\cms\shop\Module
的用法示例。
在下文中一共展示了Module::className方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: beforeUpdateCallback
public function beforeUpdateCallback($e)
{
if ($this->isAttributeChanged('canceled')) {
$this->canceled_at = \Yii::$app->formatter->asTimestamp(time());
}
if ($this->isAttributeChanged('payed')) {
$this->payed_at = \Yii::$app->formatter->asTimestamp(time());
}
if ($this->isAttributeChanged('status_code')) {
$this->status_at = \Yii::$app->formatter->asTimestamp(time());
(new ShopOrderChange(['type' => ShopOrderChange::ORDER_STATUS_CHANGED, 'shop_order_id' => $this->id, 'data' => ['status' => $this->status->name]]))->save();
//Письмо тому кто заказывает
if ($this->user->email) {
try {
\Yii::$app->mailer->view->theme->pathMap['@app/mail'][] = '@skeeks/cms/shop/mail';
\Yii::$app->mailer->compose('order-status-change', ['order' => $this])->setFrom([\Yii::$app->cms->adminEmail => \Yii::$app->cms->appName . ''])->setTo($this->user->email)->setSubject(\Yii::$app->cms->appName . ': ' . \Yii::t('skeeks/shop/app', 'Change order status') . ' #' . $this->id)->send();
} catch (\Exception $e) {
\Yii::error('Ошибка отправки email: ' . $e->getMessage(), Module::className());
}
}
}
if ($this->isAttributeChanged('allow_payment') && $this->allow_payment == Cms::BOOL_Y) {
(new ShopOrderChange(['type' => ShopOrderChange::ORDER_ALLOW_PAYMENT, 'shop_order_id' => $this->id]))->save();
//Письмо тому кто заказывает
if ($this->user->email) {
try {
\Yii::$app->mailer->view->theme->pathMap['@app/mail'][] = '@skeeks/cms/shop/mail';
\Yii::$app->mailer->compose('order-allow-payment', ['order' => $this])->setFrom([\Yii::$app->cms->adminEmail => \Yii::$app->cms->appName . ''])->setTo($this->user->email)->setSubject(\Yii::$app->cms->appName . ': ' . \Yii::t('skeeks/shop/app', 'Resolution of payment on request') . ' #' . $this->id)->send();
} catch (\Exception $e) {
\Yii::error('Ошибка отправки email: ' . $e->getMessage(), Module::className());
}
}
}
if ($this->isAttributeChanged('allow_delivery') && $this->allow_delivery == Cms::BOOL_Y) {
(new ShopOrderChange(['type' => ShopOrderChange::ORDER_ALLOW_DELIVERY, 'shop_order_id' => $this->id]))->save();
//Письмо тому кто заказывает
if ($this->user->email) {
try {
\Yii::$app->mailer->view->theme->pathMap['@app/mail'][] = '@skeeks/cms/shop/mail';
\Yii::$app->mailer->compose('order-allow-delivery', ['order' => $this])->setFrom([\Yii::$app->cms->adminEmail => \Yii::$app->cms->appName . ''])->setTo($this->user->email)->setSubject(\Yii::$app->cms->appName . ': ' . \Yii::t('skeeks/shop/app', 'Resolution of payment on request') . ' #' . $this->id)->send();
} catch (\Exception $e) {
\Yii::error('Ошибка отправки email: ' . $e->getMessage(), Module::className());
}
}
}
if ($this->isAttributeChanged('canceled') && $this->canceled == Cms::BOOL_Y) {
(new ShopOrderChange(['type' => ShopOrderChange::ORDER_CANCELED, 'shop_order_id' => $this->id, 'data' => ['reason_canceled' => $this->reason_canceled]]))->save();
//Письмо тому кто заказывает
if ($this->user->email) {
try {
\Yii::$app->mailer->view->theme->pathMap['@app/mail'][] = '@skeeks/cms/shop/mail';
\Yii::$app->mailer->compose('order-canceled', ['order' => $this])->setFrom([\Yii::$app->cms->adminEmail => \Yii::$app->cms->appName . ''])->setTo($this->user->email)->setSubject(\Yii::$app->cms->appName . ': ' . \Yii::t('skeeks/shop/app', 'Cancellations') . ' #' . $this->id)->send();
} catch (\Exception $e) {
\Yii::error('Ошибка отправки email: ' . $e->getMessage(), Module::className());
}
}
}
}