update CRUD list-management
This commit is contained in:
@@ -7,6 +7,7 @@ use yii\web\Controller;
|
||||
use yii\filters\VerbFilter;
|
||||
use yii\helpers\FileHelper;
|
||||
use app\models\CaptureLogs;
|
||||
use app\models\ListManagement;
|
||||
|
||||
/**
|
||||
* CardController implements the CRUD actions for Card model.
|
||||
@@ -76,6 +77,25 @@ class ApiController extends Controller {
|
||||
}
|
||||
}
|
||||
|
||||
public function actionGetAllFeatures() {
|
||||
$listManagement = ListManagement::find()->all();
|
||||
$allFeatures = [];
|
||||
foreach ($listManagement as $key => $value) {
|
||||
$features = json_decode($value->image, true);
|
||||
$f = [];
|
||||
foreach ($features as $k => $v) {
|
||||
$f[] = $v['features'];
|
||||
}
|
||||
$allFeatures[] = [
|
||||
"id" => $value->id,
|
||||
"name" => $value->name,
|
||||
"features" => $f
|
||||
];
|
||||
}
|
||||
Yii::$app->response->format = "json";
|
||||
return $allFeatures;
|
||||
}
|
||||
|
||||
public function generateRandomString($length = 10) {
|
||||
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
||||
$charactersLength = strlen($characters);
|
||||
|
||||
Reference in New Issue
Block a user