Browse Source
重新设计修改运费模板数据表字段,重新生成运费模板模型和curd文件,删除自提数据表is_default字段,修改相应的自提curd文件和model文件
wechat_public_accounts
重新设计修改运费模板数据表字段,重新生成运费模板模型和curd文件,删除自提数据表is_default字段,修改相应的自提curd文件和model文件
wechat_public_accounts
linyaostalker
5 years ago
14 changed files with 221 additions and 95 deletions
-
3backend/controllers/TakingSiteController.php
-
41backend/views/express-template/_form.php
-
35backend/views/express-template/create.php
-
9backend/views/express-template/view.php
-
47backend/views/taking-site/_form.php
-
4backend/views/taking-site/create.php
-
2backend/views/taking-site/index.php
-
11backend/views/taking-site/update.php
-
1backend/views/taking-site/view.php
-
30common/models/ars/ExpressTemplate.php
-
81common/models/ars/TakingSite.php
-
28common/models/searchs/ExpressTemplateSearch.php
-
4common/models/searchs/TakingSiteSearch.php
-
20console/migrations/m191203_031446_drop_column_is_default_in_table_ats_taking_site.php
@ -1,46 +1,21 @@ |
|||||
<?php |
<?php |
||||
|
|
||||
use yii\helpers\Html; |
|
||||
use yii\bootstrap4\ActiveForm; |
|
||||
|
use blobt\widgets\Icheck; |
||||
|
use common\models\ars\ExpressTemplate; |
||||
|
|
||||
/* @var $this yii\web\View */ |
/* @var $this yii\web\View */ |
||||
/* @var $model common\models\ars\ExpressTemplate */ |
/* @var $model common\models\ars\ExpressTemplate */ |
||||
/* @var $form yii\widgets\ActiveForm */ |
/* @var $form yii\widgets\ActiveForm */ |
||||
?>
|
?>
|
||||
|
|
||||
<div class="express-template-form"> |
|
||||
|
<?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>
|
||||
|
|
||||
<?php $form = ActiveForm::begin(); ?>
|
|
||||
|
<?= $form->field($model, 'calculation')->widget(Icheck::className(), ["items" => ExpressTemplate::$calculation, 'type' => "radio"]) ?>
|
||||
|
|
||||
<?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>
|
|
||||
|
<?= $form->field($model, 'basic_amount')->textInput() ?>
|
||||
|
|
||||
<?= $form->field($model, 'province')->textarea(['rows' => 6]) ?>
|
|
||||
|
<?= $form->field($model, 'basic_price')->textInput() ?>
|
||||
|
|
||||
<?= $form->field($model, 'city')->textarea(['rows' => 6]) ?>
|
|
||||
|
<?= $form->field($model, 'extra_amount')->textInput() ?>
|
||||
|
|
||||
<?= $form->field($model, 'area')->textarea(['rows' => 6]) ?>
|
|
||||
|
|
||||
<?= $form->field($model, 'billing_type')->textInput() ?>
|
|
||||
|
|
||||
<?= $form->field($model, 'extra_weight_type')->textInput() ?>
|
|
||||
|
|
||||
<?= $form->field($model, 'exemption_type')->textInput() ?>
|
|
||||
|
|
||||
<?= $form->field($model, 'basic_price')->textInput() ?>
|
|
||||
|
|
||||
<?= $form->field($model, 'extra_price')->textInput() ?>
|
|
||||
|
|
||||
<?= $form->field($model, 'exemption_amount')->textInput() ?>
|
|
||||
|
|
||||
<?= $form->field($model, 'support_taking')->textInput() ?>
|
|
||||
|
|
||||
<?= $form->field($model, 'taking_site')->textarea(['rows' => 6]) ?>
|
|
||||
|
|
||||
<div class="form-group"> |
|
||||
<?= Html::submitButton('保存', ['class' => 'btn btn-success']) ?>
|
|
||||
<?= Html::a('返回', ['index'], ['class' => 'btn btn-info']) ?>
|
|
||||
</div> |
|
||||
|
|
||||
<?php ActiveForm::end(); ?>
|
|
||||
|
|
||||
</div> |
|
||||
|
<?= $form->field($model, 'extra_price')->textInput() ?>
|
@ -1,19 +1,28 @@ |
|||||
<?php |
<?php |
||||
|
|
||||
use yii\helpers\Html; |
use yii\helpers\Html; |
||||
|
use common\models\ars\City; |
||||
|
use common\models\ars\Area; |
||||
|
|
||||
/* @var $this yii\web\View */ |
/* @var $this yii\web\View */ |
||||
/* @var $model common\models\ars\TakingSite */ |
/* @var $model common\models\ars\TakingSite */ |
||||
|
|
||||
$this->title = '编辑 Taking Site: ' . $model->name; |
|
||||
|
$this->title = '编辑: ' . $model->name; |
||||
$this->params['breadcrumbs'][] = ['label' => 'Taking Sites', 'url' => ['index']]; |
$this->params['breadcrumbs'][] = ['label' => 'Taking Sites', 'url' => ['index']]; |
||||
$this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id' => $model->id]]; |
$this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id' => $model->id]]; |
||||
$this->params['breadcrumbs'][] = 'Update '; |
$this->params['breadcrumbs'][] = 'Update '; |
||||
|
|
||||
|
$cities = City::find()->select('city_id as id,name')->where(['province_id' => $model->province])->asArray()->all(); |
||||
|
$cityList = \yii\helpers\ArrayHelper::map($cities, 'id', 'name'); |
||||
|
$areas = Area::find()->select('area_id as id,name')->where(['city_id' => $model->city])->asArray()->all(); |
||||
|
$areaList = \yii\helpers\ArrayHelper::map($areas, 'id', 'name'); |
||||
?>
|
?>
|
||||
<div class="taking-site-update"> |
<div class="taking-site-update"> |
||||
|
|
||||
<?= $this->render('_form', [ |
<?= $this->render('_form', [ |
||||
'model' => $model, |
'model' => $model, |
||||
|
'cityList' => $cityList, |
||||
|
'areaList' => $areaList |
||||
]) ?>
|
]) ?>
|
||||
|
|
||||
</div> |
</div> |
@ -0,0 +1,81 @@ |
|||||
|
<?php |
||||
|
|
||||
|
namespace common\models\ars; |
||||
|
|
||||
|
use Yii; |
||||
|
use yii\behaviors\TimestampBehavior; |
||||
|
|
||||
|
/** |
||||
|
* This is the model class for table "ats_taking_site". |
||||
|
* |
||||
|
* @property int $id |
||||
|
* @property string $name 名称 |
||||
|
* @property int $updated_at 更新时间 |
||||
|
* @property int $created_at 创建时间 |
||||
|
* @property string $province 省份 |
||||
|
* @property string $city 城市 |
||||
|
* @property string $area 区域 |
||||
|
* @property string $address 地址 |
||||
|
*/ |
||||
|
class TakingSite extends \yii\db\ActiveRecord |
||||
|
{ |
||||
|
/** |
||||
|
* {@inheritdoc} |
||||
|
*/ |
||||
|
public static function tableName() |
||||
|
{ |
||||
|
return 'ats_taking_site'; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* {@inheritdoc} |
||||
|
*/ |
||||
|
public function rules() |
||||
|
{ |
||||
|
return [ |
||||
|
[['name', 'province', 'city', 'area', 'address'], 'required'], |
||||
|
[['address'], 'string'], |
||||
|
[['name'], 'string', 'max' => 120], |
||||
|
[['province', 'city', 'area'], 'string', 'max' => 64], |
||||
|
]; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* {@inheritdoc} |
||||
|
*/ |
||||
|
public function attributeLabels() |
||||
|
{ |
||||
|
return [ |
||||
|
'id' => 'id', |
||||
|
'name' => '名称', |
||||
|
'updated_at' => '更新时间', |
||||
|
'created_at' => '创建时间', |
||||
|
'province' => '省份', |
||||
|
'city' => '城市', |
||||
|
'area' => '区域', |
||||
|
'address' => '地址', |
||||
|
]; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* @author linyao |
||||
|
* @email 602604991@qq.com |
||||
|
* @created Nov 8, 2019 |
||||
|
* |
||||
|
* 行为存储创建时间和更新时间 |
||||
|
*/ |
||||
|
public function behaviors() |
||||
|
{ |
||||
|
return [ |
||||
|
[ |
||||
|
'class' => TimestampBehavior::className(), |
||||
|
'createdAtAttribute' => 'created_at', |
||||
|
'updatedAtAttribute' => 'updated_at', |
||||
|
'value' => function() { |
||||
|
return time(); |
||||
|
}, |
||||
|
], |
||||
|
]; |
||||
|
} |
||||
|
} |
@ -0,0 +1,20 @@ |
|||||
|
<?php |
||||
|
|
||||
|
use yii\db\Migration; |
||||
|
|
||||
|
/** |
||||
|
* Class m191203_031446_drop_column_is_default_in_table_ats_taking_site |
||||
|
*/ |
||||
|
class m191203_031446_drop_column_is_default_in_table_ats_taking_site extends Migration |
||||
|
{ |
||||
|
public function up() |
||||
|
{ |
||||
|
$this->dropColumn('ats_taking_site', 'is_default'); |
||||
|
} |
||||
|
|
||||
|
public function down() |
||||
|
{ |
||||
|
$this->addColumn('ats_taking_site', 'is_default', $this->tinyInteger(1)->defaultValue(0)->comment('是否为默认,1为默认')); |
||||
|
return true; |
||||
|
} |
||||
|
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue