fix bug token - version

This commit is contained in:
dongpd 2021-04-26 14:22:57 +07:00
parent 924d23dad0
commit 70d60ff51e
3 changed files with 11 additions and 6 deletions

View File

@ -3,6 +3,6 @@
return [
'adminEmail' => 'admin@example.com',
"maxLogs" => 100000,
"maxPicture" => 2,
"maxPicture" => 5,
"version" => "1.0.7"
];

View File

@ -417,8 +417,8 @@ class ApiController extends Controller {
}
$version = \app\models\SyncUrl::findOne(['key_config' => 'version']);
if ($version) {
$token->data = $post['version'];
$token->save();
$version->data = $post['version'];
$version->save();
} else {
$model = new \app\models\SyncUrl();
$model->create([
@ -469,8 +469,12 @@ class ApiController extends Controller {
}
public function actionTest() {
$updating = \app\models\SyncUrl::findOne(['key_config' => 'updating']);
var_dump($updating->data);
// $updating = \app\models\SyncUrl::findOne(['key_config' => 'token']);
$updating = \app\models\SyncUrl::find()->all();
foreach ($updating as $key => $value) {
echo $value->key_config . " " . $value->data . "<br>";
}
exit();
}
public function actionReGenFeature() {

View File

@ -578,7 +578,8 @@ class ListManagementController extends Controller {
])), true);
foreach ($results as $key => $value) {
$images = [];
foreach ($value['images'] as $k => $v) {
$imagesReverse = array_reverse($value['images']);
foreach ($imagesReverse as $k => $v) {
if ($k < Yii::$app->params['maxPicture']) {
$key = common::generateRandomString();
$RootFolder = Yii::getAlias('@webroot') . "/data/uploads";