Like new condition, if for example the goods is less than 10, then creates the required number of goods c particular values ?
public function actionCreate() { $model = new Product(); if(<there's gotta be some condition>){ $model->category_id='2'; $model->author_id=$app->user->identity['id']; $model->name='name'; $model->content='content'; $model->price='0'; $model->keywords='NULL'; $model->description='NULL'; $model->hit='0'; $model->new='0'; return $model->save(); } }