init
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" ?>
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd">
|
||||
<acl>
|
||||
<resources>
|
||||
<resource id="Magento_Backend::admin">
|
||||
<resource id="Stemcell_Customer::salesperson" title="webinar" sortOrder="10">
|
||||
<resource id="Stemcell_Customer::salesperson_index" title="Salesperson List" sortOrder="10"/>
|
||||
</resource>
|
||||
</resource>
|
||||
</resources>
|
||||
</acl>
|
||||
</config>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" ?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
|
||||
<type name="Magento\Customer\Model\Customer\DataProviderWithDefaultAddresses">
|
||||
<plugin name="login_as_customer_customer_data_provider_plugin"
|
||||
type="Stemcell\Customer\Plugin\DataProviderWithDefaultAddressesPlugin"/>
|
||||
</type>
|
||||
|
||||
<preference for="Magento\Customer\Block\Adminhtml\Edit\Tab\View" type="Stemcell\Customer\Block\Adminhtml\Edit\Tab\View" />
|
||||
</config>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0"?>
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
|
||||
|
||||
<event name="adminhtml_customer_save_after">
|
||||
<observer name="save_salespersons_id" instance="Stemcell\Customer\Observer\SalespersonsCustomerSave" />
|
||||
</event>
|
||||
</config>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" ?>
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd">
|
||||
<menu>
|
||||
<add id="Stemcell_Customer::salesperson_index" title="销售管理" module="Stemcell_Customer" sortOrder="9999" resource="Stemcell_Customer::salesperson_index" parent="Magento_Customer::customer" action="stemcell_customer/salesperson/index"/>
|
||||
<add id="Stemcell_Customer::lab_index" title="LAB ID 管理" module="Stemcell_Customer" sortOrder="9999" resource="Stemcell_Customer::salesperson_index" parent="Magento_Customer::customer" action="stemcell_customer/lab/index"/>
|
||||
</menu>
|
||||
</config>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?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="admin">
|
||||
<route id="stemcell_customer" frontName="stemcell_customer">
|
||||
<module name="Stemcell_Customer" before="Magento_Backend"/>
|
||||
</route>
|
||||
</router>
|
||||
</config>
|
||||
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0"?>
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
|
||||
<default>
|
||||
<customer>
|
||||
<captcha>
|
||||
<user_create_sms>
|
||||
<user_create_sms_sender>1</user_create_sms_sender>
|
||||
</user_create_sms>
|
||||
<always_for>
|
||||
<user_create_sms_sender>1</user_create_sms_sender>
|
||||
<user_forgot_password_sms_sender>1</user_forgot_password_sms_sender>
|
||||
</always_for>
|
||||
</captcha>
|
||||
</customer>
|
||||
<captcha translate="label">
|
||||
<frontend>
|
||||
<areas>
|
||||
<user_create_sms_sender>
|
||||
<label>User Create Sms Send</label>
|
||||
</user_create_sms_sender>
|
||||
<user_forgot_password_sms_sender>
|
||||
<label>User Password Reset</label>
|
||||
</user_forgot_password_sms_sender>
|
||||
</areas>
|
||||
</frontend>
|
||||
</captcha>
|
||||
</default>
|
||||
</config>
|
||||
@@ -0,0 +1,106 @@
|
||||
<?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="customer_entity">
|
||||
<column name="mobile" nullable="false" xsi:type="varchar" comment="Mobile" />
|
||||
<column name="customer_type" nullable="false" xsi:type="int" comment="Customer Type" />
|
||||
<constraint xsi:type="unique" referenceId="CUSTOMER_ENTITY_MOBILE_WEBSITE_ID">
|
||||
<column name="mobile"/>
|
||||
<column name="website_id"/>
|
||||
</constraint>
|
||||
</table>
|
||||
|
||||
<table name="salesperson">
|
||||
<column xsi:type="int" name="salesperson_id" unsigned="true" nullable="false" identity="true"
|
||||
comment="Salesperson ID"/>
|
||||
<column xsi:type="varchar" name="name" nullable="false" length="255" comment="Name"/>
|
||||
<column xsi:type="varchar" name="email" nullable="false" length="255" comment="Salesperson Email"/>
|
||||
<column xsi:type="varchar" name="telephone" nullable="false" comment="Telephone" />
|
||||
<column xsi:type="int" name="customer_id" unsigned="true" nullable="false" comment="Customer Id" />
|
||||
<column xsi:type="varchar" name="rsm_email" nullable="true" length="255" comment="RSM Email"/>
|
||||
<column xsi:type="varchar" name="sisr_email" nullable="true" length="255" comment="SISR Email"/>
|
||||
<column xsi:type="varchar" name="csr_email" nullable="true" length="255" comment="CSR Email"/>
|
||||
<column xsi:type="smallint" name="is_active" unsigned="true" nullable="false" default="1" comment="Is Active"/>
|
||||
<column xsi:type="timestamp" name="created_at" on_update="false" nullable="false" default="CURRENT_TIMESTAMP"
|
||||
comment="Created At"/>
|
||||
<column xsi:type="timestamp" name="updated_at" on_update="true" nullable="false" default="CURRENT_TIMESTAMP"
|
||||
comment="Updated At"/>
|
||||
<index referenceId="salesperson_name" indexType="btree">
|
||||
<column name="name"/>
|
||||
</index>
|
||||
<index referenceId="salesperson_email" indexType="btree">
|
||||
<column name="email"/>
|
||||
</index>
|
||||
<index referenceId="salesperson_telephone" indexType="btree">
|
||||
<column name="telephone"/>
|
||||
</index>
|
||||
<index referenceId="customer_id" indexType="btree">
|
||||
<column name="customer_id"/>
|
||||
</index>
|
||||
<constraint xsi:type="primary" referenceId="PRIMARY">
|
||||
<column name="salesperson_id"/>
|
||||
</constraint>
|
||||
</table>
|
||||
|
||||
<table name="lab">
|
||||
<column xsi:type="int" name="lab_id" unsigned="true" nullable="false" identity="true"
|
||||
comment="Lab ID"/>
|
||||
<column xsi:type="varchar" name="lab_code" nullable="false" comment="Lab code"/>
|
||||
<column xsi:type="varchar" name="booking_account" nullable="false" length="255" comment="Booking Account"/>
|
||||
<column xsi:type="varchar" name="pi_sap_id" nullable="false" length="255" comment="PI SAP ID"/>
|
||||
<column xsi:type="int" name="customer_id" unsigned="true" nullable="true" comment="Customer Id" />
|
||||
<column xsi:type="varchar" name="dealer_name" nullable="true" />
|
||||
<column xsi:type="int" name="salesperson_id" unsigned="true" nullable="false" comment="Salesperson Id" />
|
||||
<column xsi:type="smallint" name="is_active" unsigned="true" nullable="false" default="1" comment="Is Active"/>
|
||||
<column xsi:type="timestamp" name="created_at" on_update="false" nullable="false" default="CURRENT_TIMESTAMP"
|
||||
comment="Created At"/>
|
||||
<column xsi:type="timestamp" name="updated_at" on_update="true" nullable="false" default="CURRENT_TIMESTAMP"
|
||||
comment="Updated At"/>
|
||||
|
||||
<index referenceId="customer_id" indexType="btree">
|
||||
<column name="customer_id"/>
|
||||
</index>
|
||||
<constraint xsi:type="primary" referenceId="PRIMARY">
|
||||
<column name="lab_id"/>
|
||||
</constraint>
|
||||
|
||||
<constraint xsi:type="unique" referenceId="unique_lab_code">
|
||||
<column name="lab_code"/>
|
||||
</constraint>
|
||||
</table>
|
||||
|
||||
<table name="avatr" resource="default" engine="innodb">
|
||||
<column xsi:type="int" name="entity_id" unsigned="true" nullable="false" identity="true" comment="Entity Id"/>
|
||||
<constraint xsi:type="primary" referenceId="PRIMARY">
|
||||
<column name="entity_id"/>
|
||||
</constraint>
|
||||
<column name="name" nullable="false" xsi:type="varchar" comment="留咨人姓名" length="255"/>
|
||||
<column name="telephone" nullable="false" xsi:type="varchar" comment="留咨人电话" length="12"/>
|
||||
<index referenceId="AVATR_TELEPHONE" indexType="btree">
|
||||
<column name="telephone"/>
|
||||
</index>
|
||||
<column name="favorite_vehicle" nullable="false" xsi:type="varchar" comment="意向车型代码,阿维塔11: 80951002, 阿维塔12: 80951005, 深蓝:80081004" length="255"/>
|
||||
<column name="province_id" nullable="false" xsi:type="int" comment="阿维塔省市表中省对应的id" identity="false" unsigned="true"/>
|
||||
<column name="city_id" nullable="false" xsi:type="int" comment="阿维塔省市表中市对应的id" identity="false" unsigned="true"/>
|
||||
<column name="is_sent" nullable="true" xsi:type="boolean" comment="是否发送成功" default="0" />
|
||||
<column name="response" nullable="true" xsi:type="text" comment="接口返回" />
|
||||
<column xsi:type="timestamp" name="created_at" on_update="false" nullable="false" default="CURRENT_TIMESTAMP"
|
||||
comment="Created At"/>
|
||||
</table>
|
||||
|
||||
<table name="cms_page">
|
||||
<column xsi:type="varchar" name="identifier" nullable="true" length="255" comment="Page String Identifier"/>
|
||||
</table>
|
||||
|
||||
<table name="customer_salesperson">
|
||||
<column name="customer_salesperson_id" xsi:type="int" unsigned="true" nullable="false" identity="true" />
|
||||
<column name="customer_id" nullable="false" xsi:type="int" unsigned="true" />
|
||||
<column name="salesperson_id" nullable="false" xsi:type="int" unsigned="true" />
|
||||
<constraint xsi:type="unique" referenceId="customer_salesperson_id">
|
||||
<column name="customer_id"/>
|
||||
<column name="salesperson_id"/>
|
||||
</constraint>
|
||||
<constraint xsi:type="primary" referenceId="PRIMARY">
|
||||
<column name="customer_salesperson_id"/>
|
||||
</constraint>
|
||||
</table>
|
||||
</schema>
|
||||
@@ -0,0 +1,61 @@
|
||||
<?xml version="1.0" ?>
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
|
||||
<preference for="Magento\Customer\Api\CustomerRepositoryInterface" type="Stemcell\Customer\Model\ResourceModel\CustomerRepository" />
|
||||
<preference for="Stemcell\Customer\Api\Data\Http\JsonResponse" type="Stemcell\Customer\Model\Data\JsonResponse" />
|
||||
<preference for="Magento\Customer\Api\AccountManagementInterface"
|
||||
type="Stemcell\Customer\Model\AccountManagement" />
|
||||
|
||||
<preference for="Magento\Customer\Model\Address\Validator\General"
|
||||
type="Stemcell\Customer\Model\Address\Validator\General" />
|
||||
<preference for="Magento\Customer\Model\Address\Validator\Country"
|
||||
type="Stemcell\Customer\Model\Address\Validator\Country" />
|
||||
|
||||
<preference for="Magento\Customer\Model\Address" type="Stemcell\Customer\Model\Address" />
|
||||
|
||||
<type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
|
||||
<arguments>
|
||||
<argument name="collections" xsi:type="array">
|
||||
<item name="salesperson_grid_data_source" xsi:type="string">salesperson_grid</item>
|
||||
<item name="lab_grid_data_source" xsi:type="string">lab_grid_data_source</item>
|
||||
</argument>
|
||||
</arguments>
|
||||
</type>
|
||||
|
||||
<virtualType name="salesperson_grid" type="Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult">
|
||||
<arguments>
|
||||
<argument name="mainTable" xsi:type="string">salesperson</argument>
|
||||
<argument name="identifierName" xsi:type="string">salesperson_id</argument>
|
||||
<argument name="resourceModel" xsi:type="string">Stemcell\Customer\Model\ResourceModel\Salesperson</argument>
|
||||
</arguments>
|
||||
</virtualType>
|
||||
|
||||
<virtualType name="lab_grid_data_source" type="Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult">
|
||||
<arguments>
|
||||
<argument name="mainTable" xsi:type="string">lab</argument>
|
||||
<argument name="identifierName" xsi:type="string">lab_id</argument>
|
||||
<argument name="resourceModel" xsi:type="string">Stemcell\Customer\Model\ResourceModel\Lab</argument>
|
||||
</arguments>
|
||||
</virtualType>
|
||||
|
||||
<preference for="Stemcell\Customer\Api\Data\SalespersonInterface" type="Stemcell\Customer\Model\Salesperson" />
|
||||
<preference for="Magento\Customer\Model\Validator\Name" type="Stemcell\Customer\Model\Validator\Name" />
|
||||
<preference for="Stemcell\Customer\Api\Data\LabInterface" type="Stemcell\Customer\Model\Lab" />
|
||||
<preference for="Stemcell\Customer\Api\SalespersonRepositoryInterface" type="Stemcell\Customer\Model\SalespersonRepository" />
|
||||
<preference for="Stemcell\Customer\Api\LabRepositoryInterface" type="Stemcell\Customer\Model\LabRepository" />
|
||||
<preference for="Magento\Customer\Model\Customer\DataProviderWithDefaultAddresses" type="Stemcell\Customer\Ui\Component\DataProvider\DataProviderWithDefaultAddresses" />
|
||||
|
||||
<type name="Magento\ImportExport\Model\Import\SampleFileProvider">
|
||||
<arguments>
|
||||
<argument name="samples" xsi:type="array">
|
||||
<item name="lab" xsi:type="string">Stemcell_Customer</item>
|
||||
</argument>
|
||||
</arguments>
|
||||
</type>
|
||||
|
||||
<preference for="Stemcell\Customer\Api\AvatrRepositoryInterface" type="Stemcell\Customer\Model\AvatrRepository"/>
|
||||
<preference for="Stemcell\Customer\Api\Data\AvatrInterface" type="Stemcell\Customer\Model\Avatr"/>
|
||||
<preference for="Stemcell\Customer\Api\Data\AvatrSearchResultsInterface" type="Magento\Framework\Api\SearchResults"/>
|
||||
|
||||
<preference for="Magento\Customer\Block\CustomerData" type="Stemcell\Customer\Block\CustomerData" />
|
||||
|
||||
</config>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0"?>
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
|
||||
<event name="sales_quote_address_save_before">
|
||||
<observer name="attach_extension_attribute" instance="Stemcell\Customer\Observer\Quote\Address\AttachExtensionAttributeObserver" />
|
||||
</event>
|
||||
<event name="adminhtml_customer_prepare_save">
|
||||
<observer name="save_salespersons_id" instance="Stemcell\Customer\Observer\SalespersonsIdSave" />
|
||||
</event>
|
||||
</config>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" ?>
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd">
|
||||
<extension_attributes for="Magento\Customer\Api\Data\CustomerInterface">
|
||||
<attribute code="mobile" type="string"/>
|
||||
<attribute code="customer_abbr" type="string"/>
|
||||
<attribute code="salespersons_id" type="string"/>
|
||||
</extension_attributes>
|
||||
</config>
|
||||
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
|
||||
<type name="Magento\Customer\CustomerData\SectionPoolInterface">
|
||||
<arguments>
|
||||
<argument name="sectionSourceMap" xsi:type="array">
|
||||
<item name="customer" xsi:type="string">Stemcell\Customer\CustomerData\Customer</item>
|
||||
</argument>
|
||||
</arguments>
|
||||
</type>
|
||||
</config>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0"?>
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
|
||||
<event name="controller_action_predispatch_commerce_customer_sms_send">
|
||||
<observer name="user_create_sms_sender" instance="Stemcell\Customer\Observer\CheckRegisterSmsObserver" />
|
||||
</event>
|
||||
<event name="controller_action_predispatch_customer_account_createpost">
|
||||
<observer name="customer_account_createpost_sms_validation" instance="Stemcell\Customer\Observer\Customer\Register\SmsValidation" />
|
||||
</event>
|
||||
<event name="controller_action_predispatch_commerce_customer_account_resetpasswordpost">
|
||||
<observer name="customer_account_resetpasswordpost" instance="Stemcell\Customer\Observer\Customer\Register\SmsValidation" />
|
||||
</event>
|
||||
</config>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
|
||||
<router id="standard">
|
||||
<route id="commerce_customer" frontName="commerce_customer">
|
||||
<module name="Stemcell_Customer" />
|
||||
</route>
|
||||
</router>
|
||||
</config>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?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="Stemcell_Customer">
|
||||
<sequence>
|
||||
<module name="Magento_Customer"/>
|
||||
<module name="Magento_Backend"/>
|
||||
</sequence>
|
||||
</module>
|
||||
</config>
|
||||
@@ -0,0 +1,72 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<widgets xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Widget:etc/widget.xsd">
|
||||
<widget id="products_list_with_more" class="Stemcell\Customer\Block\Widget\Product\ProductsList" is_email_compatible="true"
|
||||
placeholder_image="Magento_CatalogWidget::images/products_list.png" ttl="86400">
|
||||
<label translate="true">Catalog Products List With More</label>
|
||||
<description translate="true">List of Products With More</description>
|
||||
<parameters>
|
||||
<parameter name="title" xsi:type="text" required="false" visible="true">
|
||||
<label translate="true">Title</label>
|
||||
</parameter>
|
||||
<parameter name="show_pager" xsi:type="select" visible="true"
|
||||
source_model="Magento\Config\Model\Config\Source\Yesno">
|
||||
<label translate="true">Display Page Control</label>
|
||||
</parameter>
|
||||
<parameter name="more" xsi:type="text" visible="true">
|
||||
<label translate="true">More</label>
|
||||
<description translate="true">
|
||||
<![CDATA[External url or internal path]]>
|
||||
</description>
|
||||
</parameter>
|
||||
<parameter name="products_per_page" xsi:type="text" required="true" visible="true">
|
||||
<label translate="true">Number of Products per Page</label>
|
||||
<depends>
|
||||
<parameter name="show_pager" value="1" />
|
||||
</depends>
|
||||
<value>5</value>
|
||||
</parameter>
|
||||
<parameter name="products_count" xsi:type="text" required="true" visible="true">
|
||||
<label translate="true">Number of Products to Display</label>
|
||||
<value>10</value>
|
||||
</parameter>
|
||||
<parameter name="template" xsi:type="select" required="true" visible="true">
|
||||
<label translate="true">Template</label>
|
||||
<options>
|
||||
<option name="default" value="Stemcell_Customer::product/widget/content/grid.phtml" selected="true">
|
||||
<label translate="true">Products Grid Template With More</label>
|
||||
</option>
|
||||
</options>
|
||||
</parameter>
|
||||
<parameter name="cache_lifetime" xsi:type="text" visible="true">
|
||||
<label translate="true">Cache Lifetime (Seconds)</label>
|
||||
<description translate="true">
|
||||
<![CDATA[Time in seconds between the widget updates.
|
||||
<br/>If not set, equals to 86400 seconds (24 hours). To update widget instantly, go to Cache Management and clear Blocks HTML Output cache.
|
||||
<br/>Widget will not show products that begin to match the specified conditions until cache is refreshed.]]>
|
||||
</description>
|
||||
</parameter>
|
||||
<parameter name="condition" xsi:type="conditions" visible="true" required="true" sort_order="10"
|
||||
class="Magento\CatalogWidget\Block\Product\Widget\Conditions">
|
||||
<label translate="true">Conditions</label>
|
||||
</parameter>
|
||||
</parameters>
|
||||
<containers>
|
||||
<container name="content">
|
||||
<template name="grid" value="default" />
|
||||
</container>
|
||||
<container name="content.top">
|
||||
<template name="grid" value="default" />
|
||||
</container>
|
||||
<container name="content.bottom">
|
||||
<template name="grid" value="default" />
|
||||
</container>
|
||||
</containers>
|
||||
</widget>
|
||||
</widgets>
|
||||
Reference in New Issue
Block a user