backend\controllers\GoodsController::actionSurplus PHP Method

actionSurplus() public method

public actionSurplus ( $id )
    public function actionSurplus($id)
    {
        /* @var $model Goods */
        $model = Goods::findOne($id);
        if (!$model) {
            throw new NotFoundHttpException('未找到该商品。');
        }
        $dataProvider = new ActiveDataProvider(['query' => GoodsSurplus::find()->where(['goods_id' => $id]), 'sort' => ['defaultOrder' => ['id' => SORT_DESC]], 'pagination' => ['pageSize' => 20]]);
        return $this->render('surplus', ['model' => $model, 'dataProvider' => $dataProvider]);
    }