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 [ return [
'adminEmail' => 'admin@example.com', 'adminEmail' => 'admin@example.com',
"maxLogs" => 100000, "maxLogs" => 100000,
"maxPicture" => 2, "maxPicture" => 5,
"version" => "1.0.7" "version" => "1.0.7"
]; ];

View File

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

View File

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