我不知道什么是错的但我无法插入数据库.
这就是我在模型中得到的.
warranty.php
<?php
namespace app\models;
use Yii;
use yii\db\ActiveRecord;
use yii\behaviors\TimestampBehavior;
use yii\db\Expression;
use yii\helpers\VarDumper;
/**
* This is the model class for table "warrantytwo".
*
* @property integer $id
* @property string $item_no
* @property string $warranty_date
* @property string $date
* @property integer $created_by
* @property string $tstamp
*/
class Warrantytwo extends ActiveRecord
{
/**
* @inheritdoc
*/
public static function tableName()
{
return 'warrantytwo';
}
public function behaviors()
{
return [
[
'class' => TimestampBehavior::className(),
'createdAtAttribute' …Run Code Online (Sandbox Code Playgroud)