init
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
namespace Stemcell\Datacollection\Setup\Patch\Data;
|
||||
|
||||
use Magento\Framework\Setup\Patch\DataPatchInterface;
|
||||
use Magento\Framework\App\ResourceConnection;
|
||||
|
||||
class InquiryAddFieldData implements DataPatchInterface
|
||||
{
|
||||
/**
|
||||
* @var ResourceConnection
|
||||
*/
|
||||
private $resource;
|
||||
|
||||
public function __construct(
|
||||
ResourceConnection $resource
|
||||
) {
|
||||
$this->resource = $resource;
|
||||
}
|
||||
|
||||
public function apply()
|
||||
{
|
||||
$connection = $this->resource->getConnection();
|
||||
//$tableName = $this->resource->getTableName('your_table_name');
|
||||
|
||||
$sql = "
|
||||
INSERT INTO `alekseon_custom_form_record_attribute` (`entity_type_code`, `attribute_code`, `frontend_input`, `backend_type`, `frontend_label`, `source_model`, `backend_model`, `scope`, `is_required`, `visible_in_grid`, `sort_order`, `note`, `is_user_defined`, `default_value`, `is_unique`, `frontend_class`, `is_wysiwyg_enabled`, `group_code`, `input_validator`, `attribute_extra_params`, `has_option_codes`, `form_id`, `identifier`, `input_visibility`)
|
||||
VALUES
|
||||
('alekseon_custom_form_record', 'inquiry_product_sku', 'text', 'varchar', '询价商品SKU', NULL, NULL, '0', '0', '1', '60', NULL, '1', NULL, '0', NULL, '0', '1', '0', '{\"input_params\":[]}', '0', '1', 'product_sku', '1'),
|
||||
('alekseon_custom_form_record', 'inquiry_product_name', 'text', 'varchar', '询价商品名称', NULL, NULL, '0', '0', '1', '70', NULL, '1', NULL, '0', NULL, '0', '1', '0', '{\"input_params\":[]}', '0', '1', 'product_name', '1'),
|
||||
('alekseon_custom_form_record', 'inquiry_customer_id', 'text', 'varchar', '用户ID', NULL, NULL, '0', '0', '1', '0', NULL, '1', NULL, '0', NULL, '0', '1', '0', '{\"input_params\":[]}', '0', '1', '1756286643_1', '1'),
|
||||
('alekseon_custom_form_record', 'inquiry_incrementid', 'text', 'varchar', '询价编号', NULL, NULL, '0', '0', '1', '80', NULL, '1', NULL, '0', NULL, '0', '1', '0', '{\"input_params\":[]}', '0', '1', '1756286643_2', '1');
|
||||
";
|
||||
|
||||
$connection->query($sql);
|
||||
|
||||
//$connection->insert($tableName, $data);
|
||||
}
|
||||
|
||||
public static function getDependencies()
|
||||
{
|
||||
return [
|
||||
InitializationData::class
|
||||
];
|
||||
}
|
||||
|
||||
public function getAliases()
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user