ports:
- "5432:5432"
volumes:
- - pgsqldata:/var/lib/postgresql
+ - pgsqldata:/var/lib/postgresql/data
env_file: ./docker/db/dev.db-pgsql.env
pgadmin-yii_erp24:
public function actionUpload() {
set_time_limit(600);
+ file_put_contents(self::OUT_DIR . '/a2_upload_in.json', PHP_EOL . date('Y-m-d H:i:s') . ' ', FILE_APPEND | LOCK_EX);
+
Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;
$request = Yii::$app->request->getRawBody();
} catch (Exception $ex) {
return $this->asJson(['error' => ['code' => 400, 'message' => 'Json body invalid']]);
}
+ if (empty($result)) {
+ file_put_contents(self::OUT_DIR . '/error_upload.txt',
+ PHP_EOL . 'result empty', FILE_APPEND);
+ return $this->asJson(['error' => ['code' => 400, 'message' => 'result empty']]);
+ }
$requestId = '';
if (!empty($result["request_id"])) {
}
$mess["result"] = true;
$checks_dell = "";
- $request_id = $result["request_id"];
+ $request_id = time();
+ if (array_key_exists("request_id", $result) && !empty($result["request_id"])) {
+ $request_id = $result["request_id"];
+ }
$type_price = "Розничная цена";
if (!empty($request_id)) {
* @return mixed
*/
public static function getRow($query, $args = []) {
+ if(!isset($GLOBALS["sql_cnt"])) {
+ $GLOBALS["sql_cnt"] = 0;
+ }
@$GLOBALS["sql_cnt"]++;
return self::run($query, $args)->fetch();
}
* @return array
*/
public static function getRows($query, $args = []) {
+ if(!isset($GLOBALS["sql_cnt"])) {
+ $GLOBALS["sql_cnt"] = 0;
+ }
@$GLOBALS["sql_cnt"]++;
return self::run($query, $args)->fetchAll();
}
* @return mixed
*/
public static function getValue($query, $args = []) {
+ if(!isset($GLOBALS["sql_cnt"])) {
+ $GLOBALS["sql_cnt"] = 0;
+ }
@$GLOBALS["sql_cnt"]++;
$result = self::getRow($query, $args);
if (!empty($result)) {
* @return array
*/
public static function getColumn($query, $args = []) {
+ if(!isset($GLOBALS["sql_cnt"])) {
+ $GLOBALS["sql_cnt"] = 0;
+ }
@$GLOBALS["sql_cnt"]++;
return self::run($query, $args)->fetchAll(PDO::FETCH_COLUMN);
}
public static function getCol($query, $args = []) {
+ if(!isset($GLOBALS["sql_cnt"])) {
+ $GLOBALS["sql_cnt"] = 0;
+ }
$GLOBALS["sql_cnt"]++;
return self::run($query, $args)->fetch(PDO::FETCH_NAMED);
}
public static function sql($query, $args = [])
- { $GLOBALS["sql_cnt"]++;
+ {
+ if(!isset($GLOBALS["sql_cnt"])) {
+ $GLOBALS["sql_cnt"] = 0;
+ }
+ $GLOBALS["sql_cnt"]++;
self::run($query, $args);
}
echo '</table>';
}
echo'<br><button name=save value=1 type=submit class="btn btn-success">Сохранить</button></form>';
+echo'<p><button class="btn"><a href="/cron/1c">Обновить</a></button></p>';
$m=array();
$request_id=time();
$m["request_id"]=$request_id;
- $db::sql("INSERT INTO api_cron (id, date, date_up, json_post,request_id) VALUES (0, NOW(), NOW(),?,?)",[$json2,$request_id]);
+ $db::sql("INSERT INTO api_cron (date, date_up, status,json_post,request_id) VALUES (NOW(), NOW(), 0, ?, ?)",[$json2,$request_id]);
}
$status_arr=[0=>"ожидает выполнения",1=>"выполнено"];
-$data = $db::getRows("SELECT * FROM api_cron WHERE 1 order by date DESC LIMIT 30 ");
+$data = $db::getRows("SELECT * FROM api_cron WHERE 1=1 order by date DESC LIMIT 30 ");
echo"<h3>Здания для 1с</h3><table class=\"table table-hover table-sm\"><tbody>";
foreach($data as $row) {
echo"<tr"; if($row["status"]==0) echo" class=\"bg-warning\" ";