You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
683 B

  1. <?php
  2. namespace api\controllers;
  3. use backend\models\ars\Address;
  4. use Yii;
  5. use yii\web\NotFoundHttpException;
  6. /**
  7. * @author iron
  8. * @email weiriron@gmail.com
  9. */
  10. class AddressController extends CommonController
  11. {
  12. public $modelClass = 'backend\models\ars\Address';
  13. public function actions()
  14. {
  15. $action = parent::actions();
  16. return $action;
  17. }
  18. public function actionIndex()
  19. {
  20. return Address::find()
  21. ->where(['user_id' => Yii::$app->user->getId()])
  22. ->all();
  23. }
  24. public function actionUpdate()
  25. {
  26. }
  27. public function actionCreate()
  28. {
  29. return Yii::$app->address->create();
  30. }
  31. }