|
@ -3,12 +3,14 @@ |
|
|
namespace antgoods\goods\controllers; |
|
|
namespace antgoods\goods\controllers; |
|
|
|
|
|
|
|
|
use common\models\ars\TemFile; |
|
|
use common\models\ars\TemFile; |
|
|
|
|
|
use MongoDB\Driver\Manager; |
|
|
use Yii; |
|
|
use Yii; |
|
|
use antgoods\goods\models\ars\Goods; |
|
|
use antgoods\goods\models\ars\Goods; |
|
|
use antgoods\goods\models\searchs\GoodsSearch; |
|
|
use antgoods\goods\models\searchs\GoodsSearch; |
|
|
use yii\web\Controller; |
|
|
use yii\web\Controller; |
|
|
use yii\web\NotFoundHttpException; |
|
|
use yii\web\NotFoundHttpException; |
|
|
use yii\filters\VerbFilter; |
|
|
use yii\filters\VerbFilter; |
|
|
|
|
|
use antgoods\goods\logic\goods\GoodsManager; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* GoodsController implements the CRUD actions for Goods model. |
|
|
* GoodsController implements the CRUD actions for Goods model. |
|
@ -80,7 +82,10 @@ class GoodsController extends Controller |
|
|
$model = new Goods(); |
|
|
$model = new Goods(); |
|
|
|
|
|
|
|
|
if ($model->load(Yii::$app->request->post())) { |
|
|
if ($model->load(Yii::$app->request->post())) { |
|
|
|
|
|
$file_id_str = $model->imageId; |
|
|
$model->save(); |
|
|
$model->save(); |
|
|
|
|
|
$goods_manager = new GoodsManager(); |
|
|
|
|
|
$goods_manager->saveFile($file_id_str, $model); |
|
|
return $this->redirect('index'); |
|
|
return $this->redirect('index'); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|