26 lines
686 B
PHP
26 lines
686 B
PHP
<?php
|
|
|
|
namespace app\controllers\api\v1;
|
|
|
|
use app\controllers\BaseController;
|
|
use app\models\Brand;
|
|
use app\models\BrandRunway;
|
|
use yii\web\Controller;
|
|
|
|
class IndexController extends BaseController
|
|
{
|
|
public function actionMain()
|
|
{
|
|
|
|
$model = BrandRunway::find()->where(['is_deleted' => 0])->limit(2)->asArray()->all();
|
|
|
|
foreach ($model as &$item) {
|
|
$item['cover'] = 'http://static.23cm.cn/11133613f321ed5eae0dc597f3451cae/37fdd980e520e8632f271730a30e88fc-h480';
|
|
$item['brand_name'] = Brand::findOne($item['brand_id'])->name;
|
|
}
|
|
return $this->asJson([
|
|
'code' => 0,
|
|
'data' => $model
|
|
]);
|
|
}
|
|
} |