}
}
if (!empty($result['self_cost'])) {
-
-
$storeMap = [];
-
$cityStoreIds = CityStore::find()->select('id')->column();
// Получаем соответствия export_val => entity_id из таблицы ExportImportTable
$storeMap[$record->export_val] = $record->entity_id;
}
-
$values = [];
-
foreach ($result['self_cost'] as $selfCost) {
-
$storeId = $storeMap[$selfCost['store_id']] ?? null;
if (!$storeId) {
continue;
}
if (!empty($values)) {
-
-
$this->setSelfCostUpdate($values);
-
}
}
include_once(dirname(__DIR__, 2) . "/inc/base_new.php");
if(!empty($_REQUEST["parent_id"])) { $parent_id=htmlentities($_REQUEST["parent_id"]);
-$q = "SELECT p.id, p.name, e.entity_id, p.view FROM products_1c as p LEFT JOIN export_import_table as e ON e.export_iD e.export_val=p.id='1' AND e.entity='products' ANd WHERE p.tip='products' AND p.parent_id=? order by p.name ASC";
+$q = "SELECT p.id, p.name, e.entity_id, p.view FROM products_1c as p LEFT JOIN export_import_table as e ON e.export_id='1' AND e.entity='products' AND e.export_val=p.id WHERE p.tip='products' AND p.parent_id=? order by p.name ASC";
$data = $db::getRows($q,[$parent_id]);
*/
public static function getProducts1cByType(string $tip, $guids = [], $parentIds = [], $orderBy = null, $view = null) : array
{
-
$query = self::find()
->select(['name', 'id' , 'parent_id'])
->andWhere('tip=:tip', [':tip' => $tip]);
*/
public static function getProducts1c(array $guids = [], $indexById = false) : array
{
-
$query = self::find();
if (!empty($guids)) {
public function attributeLabels()
{
return [
-
'product_id' => 'Product ID',
'property_id' => 'Property ID',
'value' => 'Value Name',
public function rules()
{
return [
-
[['id', 'options', 'provider_id', 'expiration_days', 'min_lot',
'colors', 'price_zakup', 'min_order', 'group_id', 'main'], 'required'],
[['options', 'colors'], 'string'],
*/
class ProductsClass extends \yii\db\ActiveRecord
{
-
public const HINT_WRAP = 'wrap';
public const HINT_POTTED = 'potted';
public const HINT_SERVICES = 'services';
public const HINT_MARKETPLACE_ADDITIONAL = 'marketplace_additional';
public const HINT_RELATED = 'related';
public const HINT_OTHER_ITEMS = 'other_items';
-
public const MARKETPLACE = 'marketplace'; // TODO: replace with HINT_MARKETPLACE
public const MARKETPLACE_ADDITIONAL = 'marketplace_additional'; // TODO: replace with HINT_MARKETPLACE_ADDITIONAL