Roman

Roman

С нами с 21 августа 2017; Место в рейтинге пользователей: #136
Roman
28 октября 2021, 09:48
0
Спасибо! Заработало! Вчера весь мозг вынес себе XD
Roman
24 июля 2020, 12:27
0
Но только вот почему это мешает продлить SSL сертификат?
Roman
21 марта 2020, 14:16
0
У Вас несколько опросов на странице?
Roman
03 февраля 2020, 20:03
0
В логах пусто. Адресата пробовал менять на gmail.com, в спаме в первую очередь проверял.
Roman
30 января 2020, 10:17
0
нужно чтобы было:
3.25, а не 03:25
Roman
20 января 2020, 12:53
0
Изваял маленький скрипт, вытаскивающий кол-во просмотров
if(!$videoid)
{
  $output = 'Введите ID видео';
  return $output;
}
$tpl = $modx->getOption('tpl', $scriptProperties, 'tpl.videoGallery.views');

  $Youtube_API_KEY = $modx->getOption('videogallery_youtube_api_key');
    $json = file_get_contents("https://www.googleapis.com/youtube/v3/videos?part=statistics&id=" . $videoid . "&key=". $Youtube_API_KEY );
    $jsonData = json_decode($json);
    $views = $jsonData->items[0]->statistics->viewCount;

    $output = $modx->getChunk($tpl, array(
        'views' => $views
    ));    

    return  $output;
Мой первый скрипт. Возможно говнокод — но он работает XD.
UPD: хотелось бы увидеть в новой обнове videoGallery возможность подтягивать просмотры с видеороликов.
Roman
17 января 2020, 16:44
0
UDP: PT — не знаю что. 02M минуты 07S — сек. Не доперло изначально, думал что это за формат странный какой то XD.
{$videoDuration | replace : "PT" : "" | replace : "M" : ":" | replace : "S" : ""}
Roman
17 января 2020, 15:55
0
Приветствую! У меня в продолжительность ролика попадают данные вида: PT02M07S
Что это за формат?
Roman
08 января 2020, 21:15
0
А вот с innerJoin заработало! Спасибо большое за направление!
[[!msProducts?
    &parents=`3`
    &limit=`10`
    &showLog=`1`
    &tpl=`tpl.msProducts.row.single2`
      &innerJoin=`{
      "option1": {
        "class": "msProductOption",
        "on": "option1.key = 'Rating' AND option1.product_id = msProduct.id AND option1.value >= 3 AND option1.value < 5"
      }
      }`
    &includeThumbs=`medium`
]]
Roman
08 января 2020, 21:04
0
Попробовал c &optionFilter=`['Rating:>=' =>3, 'AND:Rating:<=' =>5]`
не выводит нужные товары.
<pre class="msProductsLog">0.0000501: pdoTools loaded.
0.0000918: Conditions prepared
0.0000219: xPDO query object created
0.0000811: leftJoined <i>msProductData</i> as <b>Data</b>
0.0000520: leftJoined <i>msVendor</i> as <b>Vendor</b>
0.0000451: leftJoined <i>msProductFile</i> as <b>medium</b>
0.0000010: Grouped by <b>msProduct.id, `medium`.url</b>
0.0000200: Added selection of <b>msProduct</b>: <small>`id`, `type`, `contentType`, `pagetitle`, `longtitle`, `description`, `alias`, `alias_visible`, `link_attributes`, `published`, `pub_date`, `unpub_date`, `parent`, `isfolder`, `introtext`, `richtext`, `template`, `menuindex`, `searchable`, `cacheable`, `createdby`, `createdon`, `editedby`, `editedon`, `deleted`, `deletedon`, `deletedby`, `publishedon`, `publishedby`, `menutitle`, `donthit`, `privateweb`, `privatemgr`, `content_dispo`, `hidemenu`, `class_key`, `context_key`, `content_type`, `uri`, `uri_override`, `hide_children_in_tree`, `show_in_tree`, `properties`</small>
0.0000091: Added selection of <b>msProductData</b>: <small>`article`, `price`, `old_price`, `weight`, `image`, `thumb`, `vendor`, `made_in`, `new`, `popular`, `favorite`, `tags`, `color`, `size`, `source`</small>
0.0000081: Added selection of <b>msVendor</b>: <small>`name` AS `vendor.name`, `resource` AS `vendor.resource`, `country` AS `vendor.country`, `logo` AS `vendor.logo`, `address` AS `vendor.address`, `phone` AS `vendor.phone`, `fax` AS `vendor.fax`, `email` AS `vendor.email`, `description` AS `vendor.description`, `properties` AS `vendor.properties`</small>
0.0000041: Added selection of <b>msProductFile</b>: <small>url as `medium`</small>
0.0007470: Processed additional conditions
0.0008922: Added where condition: <b>class_key=msProduct, msProduct.parent:IN(3,860,861,867,874,878,880,881,882,888,893,897,903,906,910,920,926,960,1013,1018,1023,862,863,864,865,866,1172,1173,1174,868,869,870,871,872,873,875,876,877,879,883,884,885,886,887,1159,1160,1161,889,890,891,892,894,895,896,898,899,900,901,902,904,905,1162,907,908,909,911,912,913,914,915,916,917,918,919,1168,921,922,923,924,925,927,928,929,930,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,961,962,963,964,965,966,967,968,969,970,971,972,973,974,975,976,977,978,979,980,981,982,983,984,985,986,987,988,989,990,991,992,993,994,995,996,997,998,999,1000,1001,1002,1003,1004,1005,1006,1007,1008,1009,1010,1011,1012,1165,1170,1167,1163,1166,1164,1171,1169,1014,1015,1016,1017,1019,1020,1021,1022,1024,1025,1026,1027), msProduct.published=1, msProduct.deleted=0</b>
0.0000291: Sorted by <b>msProduct.id</b>, <b>ASC</b>
0.0000019: Limited to <b>10</b>, offset <b>0</b>
0.0001681: SQL prepared <small>"SELECT `msProduct`.`id`, `msProduct`.`type`, `msProduct`.`contentType`, `msProduct`.`pagetitle`, `msProduct`.`longtitle`, `msProduct`.`description`, `msProduct`.`alias`, `msProduct`.`alias_visible`, `msProduct`.`link_attributes`, `msProduct`.`published`, `msProduct`.`pub_date`, `msProduct`.`unpub_date`, `msProduct`.`parent`, `msProduct`.`isfolder`, `msProduct`.`introtext`, `msProduct`.`richtext`, `msProduct`.`template`, `msProduct`.`menuindex`, `msProduct`.`searchable`, `msProduct`.`cacheable`, `msProduct`.`createdby`, `msProduct`.`createdon`, `msProduct`.`editedby`, `msProduct`.`editedon`, `msProduct`.`deleted`, `msProduct`.`deletedon`, `msProduct`.`deletedby`, `msProduct`.`publishedon`, `msProduct`.`publishedby`, `msProduct`.`menutitle`, `msProduct`.`donthit`, `msProduct`.`privateweb`, `msProduct`.`privatemgr`, `msProduct`.`content_dispo`, `msProduct`.`hidemenu`, `msProduct`.`class_key`, `msProduct`.`context_key`, `msProduct`.`content_type`, `msProduct`.`uri`, `msProduct`.`uri_override`, `msProduct`.`hide_children_in_tree`, `msProduct`.`show_in_tree`, `msProduct`.`properties`, `Data`.`article`, `Data`.`price`, `Data`.`old_price`, `Data`.`weight`, `Data`.`image`, `Data`.`thumb`, `Data`.`vendor`, `Data`.`made_in`, `Data`.`new`, `Data`.`popular`, `Data`.`favorite`, `Data`.`tags`, `Data`.`color`, `Data`.`size`, `Data`.`source`, `Vendor`.`name` AS `vendor.name`, `Vendor`.`resource` AS `vendor.resource`, `Vendor`.`country` AS `vendor.country`, `Vendor`.`logo` AS `vendor.logo`, `Vendor`.`address` AS `vendor.address`, `Vendor`.`phone` AS `vendor.phone`, `Vendor`.`fax` AS `vendor.fax`, `Vendor`.`email` AS `vendor.email`, `Vendor`.`description` AS `vendor.description`, `Vendor`.`properties` AS `vendor.properties`, `medium`.url as `medium` FROM `qzJhWwMZkqLc_site_content` AS `msProduct` LEFT JOIN `qzJhWwMZkqLc_ms2_products` `Data` ON `msProduct`.`id` =  `Data`.`id` LEFT JOIN `qzJhWwMZkqLc_ms2_vendors` `Vendor` ON Data.vendor=Vendor.id LEFT JOIN `qzJhWwMZkqLc_ms2_product_files` `medium` ON `medium`.product_id = msProduct.id AND `medium`.rank = 0 AND `medium`.path LIKE '%/medium/%' WHERE  ( `msProduct`.`class_key` = 'msProduct' AND `msProduct`.`parent` IN (3,860,861,867,874,878,880,881,882,888,893,897,903,906,910,920,926,960,1013,1018,1023,862,863,864,865,866,1172,1173,1174,868,869,870,871,872,873,875,876,877,879,883,884,885,886,887,1159,1160,1161,889,890,891,892,894,895,896,898,899,900,901,902,904,905,1162,907,908,909,911,912,913,914,915,916,917,918,919,1168,921,922,923,924,925,927,928,929,930,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,961,962,963,964,965,966,967,968,969,970,971,972,973,974,975,976,977,978,979,980,981,982,983,984,985,986,987,988,989,990,991,992,993,994,995,996,997,998,999,1000,1001,1002,1003,1004,1005,1006,1007,1008,1009,1010,1011,1012,1165,1170,1167,1163,1166,1164,1171,1169,1014,1015,1016,1017,1019,1020,1021,1022,1024,1025,1026,1027) AND `msProduct`.`published` = 1 AND `msProduct`.`deleted` = 0 )  GROUP BY msProduct.id, `medium`.url ORDER BY msProduct.id ASC LIMIT 10 "</small>
0.0023639: SQL executed
0.0000701: Rows fetched
0.0000999: Returning raw data
0.0004129: Checked the active modifiers
0.0010409: Loaded "modChunk" with name "tpl.msProducts.row.single2"
0.0010371: Retrieved data from cache "default/pdotools/modchunk/71"
0.0068295: Time to load products options
0.0294430: <b>Total time</b>
4 194 304: <b>Memory usage</b>
</pre>
Roman
07 января 2020, 21:00
0
Так тоже не работает.
[[!msProducts?
&parents=`3`
&limit=`10`
&tpl=`tpl.msProducts.row.single2`
&optionFilters=`{"Rating:>=":3,"Rating:<=":5}`
&includeThumbs=`medium`
&showLog=`1`
]]
Roman
07 января 2020, 20:51
0
Так отрабатывает:
[[!msProducts?
                                        &parents=`3`
                                        &limit=`10`
                                        &tpl=`tpl.msProducts.row.single2`
                                        &optionFilters=`{"Rating:>=":3}`
                                        &includeThumbs=`medium`
                                        &showLog=`1`
                                    ]]

Но условие не то
0.0000429: pdoTools loaded.
0.0000932: Conditions prepared
0.0000150: xPDO query object created
0.0000739: leftJoined <i>msProductData</i> as <b>Data</b>
0.0000539: leftJoined <i>msVendor</i> as <b>Vendor</b>
0.0000439: leftJoined <i>msProductFile</i> as <b>medium</b>
0.0000432: leftJoined <i>msProductOption</i> as <b>Rating</b>
0.0000010: Grouped by <b>msProduct.id, `medium`.url</b>
0.0000212: Added selection of <b>msProduct</b>: <small>`id`, `type`, `contentType`, `pagetitle`, `longtitle`, `description`, `alias`, `alias_visible`, `link_attributes`, `published`, `pub_date`, `unpub_date`, `parent`, `isfolder`, `introtext`, `richtext`, `template`, `menuindex`, `searchable`, `cacheable`, `createdby`, `createdon`, `editedby`, `editedon`, `deleted`, `deletedon`, `deletedby`, `publishedon`, `publishedby`, `menutitle`, `donthit`, `privateweb`, `privatemgr`, `content_dispo`, `hidemenu`, `class_key`, `context_key`, `content_type`, `uri`, `uri_override`, `hide_children_in_tree`, `show_in_tree`, `properties`</small>
0.0000091: Added selection of <b>msProductData</b>: <small>`article`, `price`, `old_price`, `weight`, `image`, `thumb`, `vendor`, `made_in`, `new`, `popular`, `favorite`, `tags`, `color`, `size`, `source`</small>
0.0000079: Added selection of <b>msVendor</b>: <small>`name` AS `vendor.name`, `resource` AS `vendor.resource`, `country` AS `vendor.country`, `logo` AS `vendor.logo`, `address` AS `vendor.address`, `phone` AS `vendor.phone`, `fax` AS `vendor.fax`, `email` AS `vendor.email`, `description` AS `vendor.description`, `properties` AS `vendor.properties`</small>
0.0000050: Added selection of <b>msProductFile</b>: <small>url as `medium`</small>
0.0008221: Processed additional conditions
0.0009320: Added where condition: <b>class_key=msProduct, Rating.value:>==3, msProduct.parent:IN(3,860,861,867,874,878,880,881,882,888,893,897,903,906,910,920,926,960,1013,1018,1023,862,863,864,865,866,1172,1173,1174,868,869,870,871,872,873,875,876,877,879,883,884,885,886,887,1159,1160,1161,889,890,891,892,894,895,896,898,899,900,901,902,904,905,1162,907,908,909,911,912,913,914,915,916,917,918,919,1168,921,922,923,924,925,927,928,929,930,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,961,962,963,964,965,966,967,968,969,970,971,972,973,974,975,976,977,978,979,980,981,982,983,984,985,986,987,988,989,990,991,992,993,994,995,996,997,998,999,1000,1001,1002,1003,1004,1005,1006,1007,1008,1009,1010,1011,1012,1165,1170,1167,1163,1166,1164,1171,1169,1014,1015,1016,1017,1019,1020,1021,1022,1024,1025,1026,1027), msProduct.published=1, msProduct.deleted=0</b>
0.0000281: Sorted by <b>msProduct.id</b>, <b>ASC</b>
0.0000019: Limited to <b>10</b>, offset <b>0</b>
0.0001841: SQL prepared <small>"SELECT `msProduct`.`id`, `msProduct`.`type`, `msProduct`.`contentType`, `msProduct`.`pagetitle`, `msProduct`.`longtitle`, `msProduct`.`description`, `msProduct`.`alias`, `msProduct`.`alias_visible`, `msProduct`.`link_attributes`, `msProduct`.`published`, `msProduct`.`pub_date`, `msProduct`.`unpub_date`, `msProduct`.`parent`, `msProduct`.`isfolder`, `msProduct`.`introtext`, `msProduct`.`richtext`, `msProduct`.`template`, `msProduct`.`menuindex`, `msProduct`.`searchable`, `msProduct`.`cacheable`, `msProduct`.`createdby`, `msProduct`.`createdon`, `msProduct`.`editedby`, `msProduct`.`editedon`, `msProduct`.`deleted`, `msProduct`.`deletedon`, `msProduct`.`deletedby`, `msProduct`.`publishedon`, `msProduct`.`publishedby`, `msProduct`.`menutitle`, `msProduct`.`donthit`, `msProduct`.`privateweb`, `msProduct`.`privatemgr`, `msProduct`.`content_dispo`, `msProduct`.`hidemenu`, `msProduct`.`class_key`, `msProduct`.`context_key`, `msProduct`.`content_type`, `msProduct`.`uri`, `msProduct`.`uri_override`, `msProduct`.`hide_children_in_tree`, `msProduct`.`show_in_tree`, `msProduct`.`properties`, `Data`.`article`, `Data`.`price`, `Data`.`old_price`, `Data`.`weight`, `Data`.`image`, `Data`.`thumb`, `Data`.`vendor`, `Data`.`made_in`, `Data`.`new`, `Data`.`popular`, `Data`.`favorite`, `Data`.`tags`, `Data`.`color`, `Data`.`size`, `Data`.`source`, `Vendor`.`name` AS `vendor.name`, `Vendor`.`resource` AS `vendor.resource`, `Vendor`.`country` AS `vendor.country`, `Vendor`.`logo` AS `vendor.logo`, `Vendor`.`address` AS `vendor.address`, `Vendor`.`phone` AS `vendor.phone`, `Vendor`.`fax` AS `vendor.fax`, `Vendor`.`email` AS `vendor.email`, `Vendor`.`description` AS `vendor.description`, `Vendor`.`properties` AS `vendor.properties`, `medium`.url as `medium` FROM `qzJhWwMZkqLc_site_content` AS `msProduct` LEFT JOIN `qzJhWwMZkqLc_ms2_products` `Data` ON `msProduct`.`id` =  `Data`.`id` LEFT JOIN `qzJhWwMZkqLc_ms2_vendors` `Vendor` ON Data.vendor=Vendor.id LEFT JOIN `qzJhWwMZkqLc_ms2_product_files` `medium` ON `medium`.product_id = msProduct.id AND `medium`.rank = 0 AND `medium`.path LIKE '%/medium/%' LEFT JOIN `qzJhWwMZkqLc_ms2_product_options` `Rating` ON `Rating`.product_id = Data.id AND `Rating`.key = 'Rating' WHERE  ( `msProduct`.`class_key` = 'msProduct' AND `Rating`.`value` >= '3' AND `msProduct`.`parent` IN (3,860,861,867,874,878,880,881,882,888,893,897,903,906,910,920,926,960,1013,1018,1023,862,863,864,865,866,1172,1173,1174,868,869,870,871,872,873,875,876,877,879,883,884,885,886,887,1159,1160,1161,889,890,891,892,894,895,896,898,899,900,901,902,904,905,1162,907,908,909,911,912,913,914,915,916,917,918,919,1168,921,922,923,924,925,927,928,929,930,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,961,962,963,964,965,966,967,968,969,970,971,972,973,974,975,976,977,978,979,980,981,982,983,984,985,986,987,988,989,990,991,992,993,994,995,996,997,998,999,1000,1001,1002,1003,1004,1005,1006,1007,1008,1009,1010,1011,1012,1165,1170,1167,1163,1166,1164,1171,1169,1014,1015,1016,1017,1019,1020,1021,1022,1024,1025,1026,1027) AND `msProduct`.`published` = 1 AND `msProduct`.`deleted` = 0 )  GROUP BY msProduct.id, `medium`.url ORDER BY msProduct.id ASC LIMIT 10 "</small>
0.0027151: SQL executed
0.0000300: Rows fetched
0.0000339: Returning raw data
0.0005920: Checked the active modifiers
0.0011730: Loaded "modChunk" with name "tpl.msProducts.row.single2"
0.0013311: Compiled Fenom chunk with name "modchunk/71"
0.0017719: Time to load products options
0.0099621: <b>Total time</b>
6 291 456: <b>Memory usage</b>
Roman
07 января 2020, 20:44
0
Rating — это опция, а не TV шка
Roman
07 января 2020, 20:38
0
0.0000441: pdoTools loaded.
0.0001481: Conditions prepared
0.0000229: xPDO query object created
0.0003591: Included list of tvs: <b></b>
0.0001049: leftJoined <i>msProductData</i> as <b>Data</b>
0.0000479: leftJoined <i>msVendor</i> as <b>Vendor</b>
0.0000448: leftJoined <i>msProductFile</i> as <b>medium</b>
0.0000019: Grouped by <b>msProduct.id, `medium`.url</b>
0.0000200: Added selection of <b>msProduct</b>: <small>`id`, `type`, `contentType`, `pagetitle`, `longtitle`, `description`, `alias`, `alias_visible`, `link_attributes`, `published`, `pub_date`, `unpub_date`, `parent`, `isfolder`, `introtext`, `richtext`, `template`, `menuindex`, `searchable`, `cacheable`, `createdby`, `createdon`, `editedby`, `editedon`, `deleted`, `deletedon`, `deletedby`, `publishedon`, `publishedby`, `menutitle`, `donthit`, `privateweb`, `privatemgr`, `content_dispo`, `hidemenu`, `class_key`, `context_key`, `content_type`, `uri`, `uri_override`, `hide_children_in_tree`, `show_in_tree`, `properties`</small>
0.0000088: Added selection of <b>msProductData</b>: <small>`article`, `price`, `old_price`, `weight`, `image`, `thumb`, `vendor`, `made_in`, `new`, `popular`, `favorite`, `tags`, `color`, `size`, `source`</small>
0.0000079: Added selection of <b>msVendor</b>: <small>`name` AS `vendor.name`, `resource` AS `vendor.resource`, `country` AS `vendor.country`, `logo` AS `vendor.logo`, `address` AS `vendor.address`, `phone` AS `vendor.phone`, `fax` AS `vendor.fax`, `email` AS `vendor.email`, `description` AS `vendor.description`, `properties` AS `vendor.properties`</small>
0.0000041: Added selection of <b>msProductFile</b>: <small>url as `medium`</small>
0.0007989: Processed additional conditions
0.0009210: Added where condition: <b>class_key=msProduct, Rating:>==3, AND:Rating:<==4, msProduct.parent:IN(3,860,861,867,874,878,880,881,882,888,893,897,903,906,910,920,926,960,1013,1018,1023,862,863,864,865,866,1172,1173,1174,868,869,870,871,872,873,875,876,877,879,883,884,885,886,887,1159,1160,1161,889,890,891,892,894,895,896,898,899,900,901,902,904,905,1162,907,908,909,911,912,913,914,915,916,917,918,919,1168,921,922,923,924,925,927,928,929,930,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,961,962,963,964,965,966,967,968,969,970,971,972,973,974,975,976,977,978,979,980,981,982,983,984,985,986,987,988,989,990,991,992,993,994,995,996,997,998,999,1000,1001,1002,1003,1004,1005,1006,1007,1008,1009,1010,1011,1012,1165,1170,1167,1163,1166,1164,1171,1169,1014,1015,1016,1017,1019,1020,1021,1022,1024,1025,1026,1027), msProduct.published=1, msProduct.deleted=0</b>
0.0000300: Sorted by <b>msProduct.id</b>, <b>ASC</b>
0.0000019: Limited to <b>10</b>, offset <b>0</b>
0.0001969: SQL prepared <small>"SELECT `msProduct`.`id`, `msProduct`.`type`, `msProduct`.`contentType`, `msProduct`.`pagetitle`, `msProduct`.`longtitle`, `msProduct`.`description`, `msProduct`.`alias`, `msProduct`.`alias_visible`, `msProduct`.`link_attributes`, `msProduct`.`published`, `msProduct`.`pub_date`, `msProduct`.`unpub_date`, `msProduct`.`parent`, `msProduct`.`isfolder`, `msProduct`.`introtext`, `msProduct`.`richtext`, `msProduct`.`template`, `msProduct`.`menuindex`, `msProduct`.`searchable`, `msProduct`.`cacheable`, `msProduct`.`createdby`, `msProduct`.`createdon`, `msProduct`.`editedby`, `msProduct`.`editedon`, `msProduct`.`deleted`, `msProduct`.`deletedon`, `msProduct`.`deletedby`, `msProduct`.`publishedon`, `msProduct`.`publishedby`, `msProduct`.`menutitle`, `msProduct`.`donthit`, `msProduct`.`privateweb`, `msProduct`.`privatemgr`, `msProduct`.`content_dispo`, `msProduct`.`hidemenu`, `msProduct`.`class_key`, `msProduct`.`context_key`, `msProduct`.`content_type`, `msProduct`.`uri`, `msProduct`.`uri_override`, `msProduct`.`hide_children_in_tree`, `msProduct`.`show_in_tree`, `msProduct`.`properties`, `Data`.`article`, `Data`.`price`, `Data`.`old_price`, `Data`.`weight`, `Data`.`image`, `Data`.`thumb`, `Data`.`vendor`, `Data`.`made_in`, `Data`.`new`, `Data`.`popular`, `Data`.`favorite`, `Data`.`tags`, `Data`.`color`, `Data`.`size`, `Data`.`source`, `Vendor`.`name` AS `vendor.name`, `Vendor`.`resource` AS `vendor.resource`, `Vendor`.`country` AS `vendor.country`, `Vendor`.`logo` AS `vendor.logo`, `Vendor`.`address` AS `vendor.address`, `Vendor`.`phone` AS `vendor.phone`, `Vendor`.`fax` AS `vendor.fax`, `Vendor`.`email` AS `vendor.email`, `Vendor`.`description` AS `vendor.description`, `Vendor`.`properties` AS `vendor.properties`, `medium`.url as `medium` FROM `qzJhWwMZkqLc_site_content` AS `msProduct` LEFT JOIN `qzJhWwMZkqLc_ms2_products` `Data` ON `msProduct`.`id` =  `Data`.`id` LEFT JOIN `qzJhWwMZkqLc_ms2_vendors` `Vendor` ON Data.vendor=Vendor.id LEFT JOIN `qzJhWwMZkqLc_ms2_product_files` `medium` ON `medium`.product_id = msProduct.id AND `medium`.rank = 0 AND `medium`.path LIKE '%/medium/%' WHERE  ( `msProduct`.`class_key` = 'msProduct' AND `msProduct`.`Rating` >= '3' AND `msProduct`.`Rating` <= '4' AND `msProduct`.`parent` IN (3,860,861,867,874,878,880,881,882,888,893,897,903,906,910,920,926,960,1013,1018,1023,862,863,864,865,866,1172,1173,1174,868,869,870,871,872,873,875,876,877,879,883,884,885,886,887,1159,1160,1161,889,890,891,892,894,895,896,898,899,900,901,902,904,905,1162,907,908,909,911,912,913,914,915,916,917,918,919,1168,921,922,923,924,925,927,928,929,930,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,961,962,963,964,965,966,967,968,969,970,971,972,973,974,975,976,977,978,979,980,981,982,983,984,985,986,987,988,989,990,991,992,993,994,995,996,997,998,999,1000,1001,1002,1003,1004,1005,1006,1007,1008,1009,1010,1011,1012,1165,1170,1167,1163,1166,1164,1171,1169,1014,1015,1016,1017,1019,1020,1021,1022,1024,1025,1026,1027) AND `msProduct`.`published` = 1 AND `msProduct`.`deleted` = 0 )  GROUP BY msProduct.id, `medium`.url ORDER BY msProduct.id ASC LIMIT 10 "</small>
0.0005741: Could not process query, error #1054: Unknown column 'msProduct.Rating' in 'where clause'
0.0026512: <b>Total time</b>
6 291 456: <b>Memory usage</b>
Roman
24 декабря 2019, 09:48
+1
Спасибо большое! Разобрался сам)) Нужно не полностью массив передавать, а передавать его через цикл
Да, я дергаю API стороннего сервиса, нужно сделать синхронизацию товаров и категорий.
P.S.
//Формируем массив
foreach ($items as $key => $item) {
$resourcedata[] = array(
        'class_key' => 'msCategory',
        'pagetitle' => $item['Id'],
        'parent' => 3,
        'template' => 3,
        'show_in_tree' => 1,
    );
}
//Скармливаем его runProcessor' у
for($i=0; $i<count($resourcedata); $i++){
$response = $modx->runProcessor('resource/create',$resourcedata[$i]);
  if($response->isError()){
        echo 'Ошибка';
    }else{
        echo 'Создал';
    }
}
Roman
06 декабря 2019, 09:51
0
А как же корзина в интернет-магазине? Как она реализована?
Roman
10 ноября 2019, 15:03
0
Спасибо! Выкрутился через параметр &tplFirst
Roman
11 октября 2019, 13:19
0
Хук YandexMoneyHook
<?php
$eventName = $modx->event->name;
$_isAdmin = ($modx->user->sudo == 1);

if (!defined('YANDEXMONEY_PATH')) {
    define('YANDEXMONEY_PATH', MODX_CORE_PATH."components/yandexmoney/");
}
require_once YANDEXMONEY_PATH.'model/yandexmoney.class.php';

$snippet = $modx->getObject('modSnippet',array('name' => 'YandexMoney'));
$config = $snippet->getProperties();

$ym = new Yandexmoney($modx, $config);

if (!empty($_SESSION['shk_lastOrder']) && !empty($_SESSION['shk_lastOrder']['id'])) {
    $ym->pay_method = !empty($_SESSION['shk_lastOrder']['payment']) ? $_SESSION['shk_lastOrder']['payment'] : '';
    $order_id = (int)$_SESSION['shk_lastOrder']['id'];
}
if (!empty($_POST['payment'])) $ym->pay_method = $_POST['payment'];
if (!empty($_POST['email'])) $ym->email = $_POST['email'];
if (!empty($_POST['phone'])) $ym->phone = $_POST['phone'];
if (!empty($_POST['alfaLogin'])) $ym->alfaLogin = $_POST['alfaLogin'];
if (!empty($_POST['qiwiPhone'])) $ym->qiwiPhone = $_POST['qiwiPhone'];

if (!$ym->checkPayMethod()) {
    return false;
}
$modx->addPackage('shopkeeper3',  $modx->getOption('core_path').'components/shopkeeper3/model/');
$order = $modx->getObject('shk_order', $order_id);

if (!$order) {
    return false;
}
$output = '';

if ($order_id && $_POST['order']) {
    $ym->userId = $modx->getLoginUserID('web') ? $modx->getLoginUserID('web') : 0;
    $ym->orderId = $order_id;
    $ym->orderTotal = $_SESSION['shk_lastOrder']['price'];
    $ym->orderTotal = floatval(str_replace(array(',',' '), array('.',''), $ym->orderTotal));
    $ym->comment = $_POST['message'];

    $_host = str_replace(array('http://', 'https://'), '' , $modx->config['site_url']);
    $host = 'https://' . $_host . 'assets/components/yandexmoney/connector_result.php';
    $ym->successUrl = $host.'?success=1';
    $ym->failUrl = $host.'?fail=1';

    echo $ym->createFormHtml();
    exit;
}
return true;
Roman
10 октября 2019, 16:49
0
Я делал все по гайду яндекса и у меня не заработала. Ниже привел правки в коде