本文整理汇总了PHP中common\models\Order::getStatusLabels方法的典型用法代码示例。如果您正苦于以下问题:PHP Order::getStatusLabels方法的具体用法?PHP Order::getStatusLabels怎么用?PHP Order::getStatusLabels使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类common\models\Order
的用法示例。
在下文中一共展示了Order::getStatusLabels方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: function
use common\models\Order;
/* @var $this yii\web\View */
/* @var $model common\models\Order */
$this->title = $model->id;
$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Orders'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="order-view">
<p>
<?php
echo Html::a(Yii::t('app', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']);
?>
<?php
echo Html::a(Yii::t('app', 'Delete'), ['delete', 'id' => $model->id], ['class' => 'btn btn-danger', 'data' => ['confirm' => Yii::t('app', 'Are you sure you want to delete this item?'), 'method' => 'post']]);
?>
</p>
<?php
echo GridView::widget(['dataProvider' => $dataProvider, 'columns' => ['product_id', 'name', 'sku', 'price', 'number', ['attribute' => 'total', 'value' => function ($model) {
return $model->number * $model->price;
}]]]);
?>
<?php
echo DetailView::widget(['model' => $model, 'attributes' => ['id', ['attribute' => 'user_id', 'value' => $model->user ? $model->user->username : '-'], 'sn', 'consignee', ['attribute' => 'address', 'value' => (isset($model->country0) ? $model->country0->name : '-') . (isset($model->province0) ? $model->province0->name : '-') . (isset($model->city0) ? $model->city0->name : '-') . (isset($model->district0) ? $model->district0->name : '-') . $model->address], 'zipcode', 'phone', 'mobile', 'email:email', 'remark', ['attribute' => 'payment_method', 'value' => Order::getPaymentMethodLabels($model->payment_method)], ['attribute' => 'payment_status', 'value' => $model->payment_status ? Order::getPaymentStatusLabels($model->payment_status) : '-'], 'payment_id', 'payment_name', 'payment_fee', ['attribute' => 'shipment_status', 'value' => $model->shipment_status ? Order::getShipmentStatusLabels($model->shipment_status) : '-'], 'shipment_id', 'shipment_name', 'shipment_fee', 'amount', 'tax', 'invoice', ['attribute' => 'status', 'value' => Order::getStatusLabels($model->status)], 'paid_at:datetime', 'shipped_at:datetime', 'created_at:datetime', 'updated_at:datetime', ['attribute' => 'created_by', 'value' => $model->createdBy->username], ['attribute' => 'updated_by', 'value' => $model->updatedBy->username]]]);
?>
</div>
示例2:
<?php
use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model common\models\OrderLog */
$this->title = $model->id;
$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Order Logs'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="order-log-view">
<p>
<?php
echo Html::a(Yii::t('app', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']);
?>
<?php
echo Html::a(Yii::t('app', 'Delete'), ['delete', 'id' => $model->id], ['class' => 'btn btn-danger', 'data' => ['confirm' => Yii::t('app', 'Are you sure you want to delete this item?'), 'method' => 'post']]);
?>
</p>
<?php
echo DetailView::widget(['model' => $model, 'attributes' => ['id', 'order_id', ['attribute' => 'status', 'value' => \common\models\Order::getStatusLabels($model->status)], 'remark', 'created_at:datetime', 'updated_at:datetime', ['attribute' => 'created_by', 'value' => $model->createdBy->username], ['attribute' => 'updated_by', 'value' => $model->updatedBy->username]]]);
?>
</div>
示例3: foreach
foreach ($orders as $item) {
?>
<tbody>
<tr>
<th><p class="mt5 pl12"><span class="gray888">订单编号:<a href="<?php
echo Yii::$app->urlManager->createUrl(['order/view', 'id' => $item->id]);
?>
" target="_blank"><?php
echo $item->sn;
?>
</a></span> 下单时间:<?php
echo Yii::$app->formatter->asDatetime($item->created_at);
?>
</p></th>
<th width="120"> <em class="em02 tstatus_17"> <?php
echo \common\models\Order::getStatusLabels($item->status);
?>
</em> </th>
<th width="220" class="trade-count"><em>订单金额:¥</em> <em class="em_price"> <?php
echo $item->amount;
?>
</em> </th>
</tr>
<tr>
<td class="items">
<?php
foreach ($item->orderProducts as $product) {
?>
<dl class="cle_float">
<dd class="trade_img"><img src="<?php
echo $product->thumb;
示例4:
?>
<?php
echo $form->field($model, 'shipment_fee')->textInput(['maxlength' => 10]);
?>
<?php
echo $form->field($model, 'tax')->textInput(['maxlength' => 10]);
?>
<?php
echo $form->field($model, 'invoice')->textInput(['maxlength' => 255]);
?>
<?php
echo $form->field($model, 'status')->dropDownList(Order::getStatusLabels());
?>
<div class="form-group">
<label class="col-lg-2 control-label" for=""> </label>
<?php
echo Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
</div>
<?php
ActiveForm::end();
?>
</div>
示例5: function
use yii\helpers\Html;
use yii\grid\GridView;
use yii\helpers\ArrayHelper;
/* @var $this yii\web\View */
/* @var $searchModel common\models\OrderLogSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('app', 'Order Logs');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="order-log-index">
<?php
// echo $this->render('_search', ['model' => $searchModel]);
?>
<p>
<?php
echo Html::a(Yii::t('app', 'Create ') . Yii::t('app', 'Order Log'), ['create'], ['class' => 'btn btn-success']);
?>
</p>
<?php
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'id', 'order_id', ['attribute' => 'status', 'value' => function ($model) {
return \common\models\Order::getStatusLabels($model->status);
}, 'filter' => Html::activeDropDownList($searchModel, 'status', \common\models\Order::getStatusLabels(), ['class' => 'form-control', 'prompt' => Yii::t('app', 'PROMPT_STATUS')])], 'remark', 'created_at:datetime', ['attribute' => 'created_by', 'value' => function ($model) {
return $model->createdBy ? $model->createdBy->username : '-';
}], ['class' => 'yii\\grid\\ActionColumn']]]);
?>
</div>
示例6: function
} else {
$class = 'label-info';
}
return '<span class="label ' . $class . '">' . ($model->payment_status ? Order::getPaymentStatusLabels($model->payment_status) : '-') . '</span>';
}, 'filter' => Html::activeDropDownList($searchModel, 'payment_status', Order::getPaymentStatusLabels(), ['class' => 'form-control', 'prompt' => Yii::t('app', 'PROMPT_STATUS')])], ['attribute' => 'shipment_status', 'format' => 'html', 'value' => function ($model) {
if ($model->shipment_status === Order::SHIPMENT_STATUS_RECEIVED) {
$class = 'label-success';
} elseif ($model->shipment_status === Order::SHIPMENT_STATUS_SHIPPED) {
$class = 'label-warning';
} elseif ($model->shipment_status === Order::SHIPMENT_STATUS_PREPARING) {
$class = 'label-danger';
} else {
$class = 'label-info';
}
return '<span class="label ' . $class . '">' . ($model->shipment_status ? Order::getShipmentStatusLabels($model->shipment_status) : '-') . '</span>';
}, 'filter' => Html::activeDropDownList($searchModel, 'shipment_status', Order::getShipmentStatusLabels(), ['class' => 'form-control', 'prompt' => Yii::t('app', 'PROMPT_STATUS')])], 'amount', ['attribute' => 'status', 'format' => 'html', 'value' => function ($model) {
if ($model->status === Order::SHIPMENT_STATUS_RECEIVED) {
$class = 'label-success';
} elseif ($model->status === Order::PAYMENT_STATUS_UNPAID) {
$class = 'label-warning';
} elseif ($model->status === Order::STATUS_CANCEL || $model->status === Order::STATUS_DELETED) {
$class = 'label-danger';
} else {
$class = 'label-info';
}
return '<span class="label ' . $class . '">' . Order::getStatusLabels($model->status) . '</span>';
}, 'filter' => Html::activeDropDownList($searchModel, 'status', Order::getStatusLabels(), ['class' => 'form-control', 'prompt' => Yii::t('app', 'PROMPT_STATUS')])], 'created_at:date', ['class' => 'yii\\grid\\ActionColumn']]]);
?>
</div>