This commit is contained in:
2026-09-15 10:35:56 +08:00
commit 782f8ea7aa
4086 changed files with 631288 additions and 0 deletions
@@ -0,0 +1,8 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="Magento\Review\Block\Adminhtml\Edit\Form">
<plugin name="esun_admin_review_images"
type="Esun\Review\Plugin\Adminhtml\Review\FormImagesPlugin"/>
</type>
</config>
+73
View File
@@ -0,0 +1,73 @@
<?xml version="1.0"?>
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
<table name="sales_order" resource="sales">
<column xsi:type="timestamp" name="customer_confirmed_at" nullable="true"
on_update="false" comment="Customer Confirmed Receipt At"/>
</table>
<table name="esun_review_image" resource="default" engine="innodb" comment="Esun Review Images">
<column xsi:type="int" name="image_id" unsigned="true" nullable="false" identity="true" comment="Image ID"/>
<column xsi:type="bigint" name="review_id" unsigned="true" nullable="false" comment="Review ID"/>
<column xsi:type="int" name="customer_id" unsigned="true" nullable="true" comment="Customer ID"/>
<column xsi:type="varchar" name="image_path" nullable="false" length="1024" comment="Image Path"/>
<column xsi:type="varchar" name="thumbnail_path" nullable="true" length="1024" comment="Thumbnail Path"/>
<column xsi:type="varchar" name="media_type" nullable="false" length="16" default="image" comment="Media Type"/>
<column xsi:type="smallint" name="status" unsigned="true" nullable="false" default="1" comment="Status"/>
<column xsi:type="int" name="sort_order" nullable="false" default="0" comment="Sort Order"/>
<column xsi:type="timestamp" name="created_at" nullable="false" default="CURRENT_TIMESTAMP" comment="Created At"/>
<constraint xsi:type="primary" referenceId="PRIMARY">
<column name="image_id"/>
</constraint>
<constraint xsi:type="foreign" referenceId="ESUN_REVIEW_IMAGE_REVIEW_ID_REVIEW_REVIEW_ID"
table="esun_review_image" column="review_id"
referenceTable="review" referenceColumn="review_id"
onDelete="CASCADE"/>
<index referenceId="ESUN_REVIEW_IMAGE_REVIEW_STATUS_SORT" indexType="btree">
<column name="review_id"/>
<column name="status"/>
<column name="sort_order"/>
</index>
</table>
<table name="esun_review_vote" resource="default" engine="innodb" comment="Esun Review Helpful Votes">
<column xsi:type="int" name="vote_id" unsigned="true" nullable="false" identity="true" comment="Vote ID"/>
<column xsi:type="bigint" name="review_id" unsigned="true" nullable="false" comment="Review ID"/>
<column xsi:type="int" name="customer_id" unsigned="true" nullable="false" comment="Customer ID"/>
<column xsi:type="smallint" name="vote_type" nullable="false" comment="Vote Type"/>
<column xsi:type="timestamp" name="created_at" nullable="false" default="CURRENT_TIMESTAMP" comment="Created At"/>
<constraint xsi:type="primary" referenceId="PRIMARY">
<column name="vote_id"/>
</constraint>
<constraint xsi:type="unique" referenceId="ESUN_REVIEW_VOTE_REVIEW_CUSTOMER_UNQ">
<column name="review_id"/>
<column name="customer_id"/>
</constraint>
<constraint xsi:type="foreign" referenceId="ESUN_REVIEW_VOTE_REVIEW_ID_REVIEW_REVIEW_ID"
table="esun_review_vote" column="review_id"
referenceTable="review" referenceColumn="review_id"
onDelete="CASCADE"/>
<index referenceId="ESUN_REVIEW_VOTE_REVIEW_TYPE" indexType="btree">
<column name="review_id"/>
<column name="vote_type"/>
</index>
<index referenceId="ESUN_REVIEW_VOTE_CUSTOMER" indexType="btree">
<column name="customer_id"/>
</index>
</table>
<table name="esun_review_purchase" resource="default" engine="innodb" comment="eSUN Review Purchase Links">
<column xsi:type="int" name="purchase_review_id" unsigned="true" nullable="false" identity="true" comment="ID"/>
<column xsi:type="bigint" name="review_id" unsigned="true" nullable="false" comment="Review ID"/>
<column xsi:type="int" name="customer_id" unsigned="true" nullable="false" comment="Customer ID"/>
<column xsi:type="int" name="order_id" unsigned="true" nullable="false" comment="Order ID"/>
<column xsi:type="int" name="order_item_id" unsigned="true" nullable="false" comment="Order Item ID"/>
<column xsi:type="int" name="product_id" unsigned="true" nullable="false" comment="Product ID"/>
<column xsi:type="varchar" name="eligibility_type" nullable="false" length="32" default="payment_success" comment="Eligibility Type"/>
<column xsi:type="timestamp" name="created_at" nullable="false" default="CURRENT_TIMESTAMP" comment="Created At"/>
<constraint xsi:type="primary" referenceId="PRIMARY"><column name="purchase_review_id"/></constraint>
<constraint xsi:type="unique" referenceId="ESUN_REVIEW_PURCHASE_REVIEW_UNQ"><column name="review_id"/></constraint>
<constraint xsi:type="unique" referenceId="ESUN_REVIEW_PURCHASE_CUSTOMER_PRODUCT_UNQ"><column name="customer_id"/><column name="product_id"/></constraint>
<constraint xsi:type="foreign" referenceId="ESUN_REVIEW_PURCHASE_REVIEW_ID_REVIEW_REVIEW_ID" table="esun_review_purchase" column="review_id" referenceTable="review" referenceColumn="review_id" onDelete="CASCADE"/>
<constraint xsi:type="foreign" referenceId="ESUN_REVIEW_PURCHASE_ORDER_ID_SALES_ORDER_ENTITY_ID" table="esun_review_purchase" column="order_id" referenceTable="sales_order" referenceColumn="entity_id" onDelete="CASCADE"/>
<constraint xsi:type="foreign" referenceId="ESUN_REVIEW_PURCHASE_ORDER_ITEM_ID_SALES_ORDER_ITEM_ITEM_ID" table="esun_review_purchase" column="order_item_id" referenceTable="sales_order_item" referenceColumn="item_id" onDelete="CASCADE"/>
</table>
</schema>
@@ -0,0 +1,65 @@
{
"sales_order": {
"column": {
"customer_confirmed_at": true
}
},
"esun_review_image": {
"column": {
"image_id": true,
"review_id": true,
"customer_id": true,
"image_path": true,
"thumbnail_path": true,
"media_type": true,
"status": true,
"sort_order": true,
"created_at": true
},
"index": {
"ESUN_REVIEW_IMAGE_REVIEW_ID_STATUS_SORT_ORDER": true
},
"constraint": {
"PRIMARY": true,
"ESUN_REVIEW_IMAGE_REVIEW_ID_REVIEW_REVIEW_ID": true
}
},
"esun_review_vote": {
"column": {
"vote_id": true,
"review_id": true,
"customer_id": true,
"vote_type": true,
"created_at": true
},
"index": {
"ESUN_REVIEW_VOTE_REVIEW_ID_VOTE_TYPE": true,
"ESUN_REVIEW_VOTE_CUSTOMER_ID": true
},
"constraint": {
"PRIMARY": true,
"ESUN_REVIEW_VOTE_REVIEW_ID_CUSTOMER_ID": true,
"ESUN_REVIEW_VOTE_REVIEW_ID_REVIEW_REVIEW_ID": true
}
},
"esun_review_purchase": {
"column": {
"purchase_review_id": true,
"review_id": true,
"customer_id": true,
"order_id": true,
"order_item_id": true,
"product_id": true,
"eligibility_type": true,
"created_at": true
},
"constraint": {
"PRIMARY": true,
"ESUN_REVIEW_PURCHASE_REVIEW_ID": true,
"ESUN_REVIEW_PURCHASE_CUSTOMER_ID_PRODUCT_ID": true,
"ESUN_REVIEW_PURCHASE_REVIEW_ID_REVIEW_REVIEW_ID": true,
"ESUN_REVIEW_PURCHASE_ORDER_ID_SALES_ORDER_ENTITY_ID": true,
"ESUN_REVIEW_PURCHASE_ORDER_ITEM_ID_SALES_ORDER_ITEM_ITEM_ID": true
}
}
}
+16
View File
@@ -0,0 +1,16 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="Magento\Review\Block\Product\ReviewRenderer">
<plugin name="esun_review_renderer"
type="Esun\Review\Plugin\ReviewRendererPlugin"/>
</type>
<type name="Magento\Review\Model\Review">
<plugin name="esun_review_image_save"
type="Esun\Review\Plugin\Review\SaveImagesPlugin"/>
</type>
<type name="Magento\Review\Controller\Product\Post">
<plugin name="esun_review_require_customer"
type="Esun\Review\Plugin\Review\PostGuestGuardPlugin"/>
</type>
</config>
@@ -0,0 +1,9 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
<router id="standard">
<route id="esun_review" frontName="esun_review">
<module name="Esun_Review"/>
</route>
</router>
</config>
+11
View File
@@ -0,0 +1,11 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Esun_Review">
<sequence>
<module name="Magento_Review"/>
<module name="Magento_Customer"/>
<module name="Esun_Catalog"/>
</sequence>
</module>
</config>