2017 © Pedro Pelรกez
 

yii2-extension yii2-mlm

Yii2 Multi Level Marketing component

image

dlds/yii2-mlm

Yii2 Multi Level Marketing component

  • Tuesday, July 3, 2018
  • by dlds
  • Repository
  • 1 Watchers
  • 2 Stars
  • 2,081 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 7 Forks
  • 1 Open issues
  • 39 Versions
  • 4 % Grown

The README.md

Multi level marketing rewrds module

Module handles rewards generating from appropriate subjects., (*1)

Installation

composer require dlds/yii2-mlm, (*2)

What is MLM?

MLM is referal marketing system where user get reward for succesfull produc sharing/solding. It is similar to Affiliate marketing but has more then one rewards level. In MLM you build your own structure (own team) of users., (*3)

Exmaple:, (*4)

| โ€“โ€“ YOU
| โ€“โ€“โ€“โ€“ BOB (1st level rewards)
| โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“ ROBERT (2st level rewards)
| โ€“โ€“โ€“โ€“ ALICE (1st level rewards)
| โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“ JIMMY (2st level rewards)
| โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“ GEORGE (2st level rewards)
| โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“ MARK (3st level rewards), (*5)

In this scenario you will get some reward when any of 6 users in your structure buy a product., (*6)

Entities in Module

Folowing naming and entities are used in MLM module., (*7)

Subject, (*8)

Class which is used as source for reward generation. It is usually some sort of ProductOrder or other entity which works with user payments., (*9)

Participant, (*10)

Class which represents user identity among MLM structure., (*11)

Reward, (*12)

Class which represents single rewards entry., (*13)

Implementation of module

First of you have to prepare your database. There is MySQL Workbench schema / SQL import script showing simple example of DB structure required for implementation in app/data folder., (*14)

There are following tables:, (*15)

  1. subject
  2. participant
  3. rwd_basic
  4. rwd_extra
  5. rwd_custom

As you can see there are 3 types of rewards. There is no need to use all 3 types. Standart rewards are held in table rwd_basic. More about rewards types in secrion Reward Types., (*16)

Then you have to implement following interfaces into your application., (*17)

MlmSubjectInterface, (*18)

This interfaces is usually implemented by something like ProductOrder.php, (*19)

MlmParticipantInterface, (*20)

This interfaces is usually implemented by something like UsrIdentityModel.php, (*21)

MlmRewardInterface, (*22)

This interfaces is usually implemented by something like OrderReward.php, (*23)

How module works?

After required implementation the rewards generation and verification is processed automatically by cron and console commands., (*24)

When Subject is ready to generate rewards module will automatically generate appropiate amount of rewards based on module setup., (*25)

During creation each participant is verified if is eligible to take rewards., (*26)

After then each of this rewards is verified when reach the end of protection period of time (e.g. 14 days in which the subject order can be cancelled by user), (*27)

After that reward is approved and is ready to pay off. Paying off handling is not part of this module yet., (*28)

Module Setup

Module provides bunch of setup options which can change the rewards generation., (*29)

rules array, (*30)

Defines procentual amount of subject price will be used for each level of reward., (*31)

Example showing 40% of subject price is pushed into rewards and spread among 5 levels: php [ 1 => 20, 2 => 10, 3 => 5, 4 => 3, 5 => 2 ], (*32)

limitRules int, (*33)

Restriction for rules configuration. Defines maximal procentual sum of all rules. In example above 40 will be suitable., (*34)

delayPending int (unix format), (*35)

Indicates how long will every single reward be in protection state. During this time the reward will have PENDING state. After this delay the APPROVED/DENY state will be used., (*36)

For 1 day the value 86400 must be used. It is unix value for one day: 14 * 24 * 60 * 60 = 86400, (*37)

roundPrecision int, (*38)

Number of decimal places for reward value., (*39)

roundMode enum (Mlm::MLM_ROUND_UP | Mlm::MLM_ROUND_DOWM), (*40)

Indicates if reward value will be rounded up or down., (*41)

skipWorthlessRewards boolean, (*42)

When true the zero reward or rewards which value is 0.0000... after rounding will be ignored., (*43)

clsParticipant string, (*44)

Participant model class name in your application., (*45)

clsRewardBasic string, (*46)

Basic Rewards model class name in your application., (*47)

clsSubjects array, (*48)

Class names of all subjects in your application. You can have 1 to N subjects defined in this array and all will get rewards., (*49)

isCreatingActive boolean, (*50)

Enables / disables reward creation., (*51)

isVerifyingActive boolean, (*52)

Enables / disables reward verification. Verification is processed after protection period., (*53)

isLevelRestrictionAllowed, (*54)

When true the rewards will be created with special verification on participant. As default the participant is verified only if is eligible to take rewards. But when Level Restriction is Allowed the participant will be verified if is eligible to take reward of specific level in structure., (*55)

This means that you can restrict some participant to be able to take only 1st and 2nd level of rewards and another participant to be able to take all levels of rewards., (*56)

The Versions

03/07 2018

2.0.14

2.0.14.0

Yii2 Multi Level Marketing component

  Sources   Download

BSD

The Requires

 

The Development Requires

by Jiri Svoboda

component yii2 mlm

03/07 2018

2.0.13

2.0.13.0

Yii2 Multi Level Marketing component

  Sources   Download

BSD

The Requires

 

The Development Requires

by Jiri Svoboda

component yii2 mlm

03/07 2018

2.0.12

2.0.12.0

Yii2 Multi Level Marketing component

  Sources   Download

BSD

The Requires

 

The Development Requires

by Jiri Svoboda

component yii2 mlm

03/07 2018

2.0.11

2.0.11.0

Yii2 Multi Level Marketing component

  Sources   Download

BSD

The Requires

 

The Development Requires

by Jiri Svoboda

component yii2 mlm

03/07 2018

2.0.10

2.0.10.0

Yii2 Multi Level Marketing component

  Sources   Download

BSD

The Requires

 

The Development Requires

by Jiri Svoboda

component yii2 mlm

16/05 2018

dev-master

9999999-dev

Yii2 Multi Level Marketing component

  Sources   Download

BSD

The Requires

 

The Development Requires

by Jiri Svoboda

component yii2 mlm

16/05 2018

2.0.9

2.0.9.0

Yii2 Multi Level Marketing component

  Sources   Download

BSD

The Requires

 

The Development Requires

by Jiri Svoboda

component yii2 mlm

06/09 2017

2.0.8

2.0.8.0

Yii2 Multi Level Marketing component

  Sources   Download

BSD

The Requires

 

The Development Requires

by Jiri Svoboda

component yii2 mlm

06/09 2017

2.0.7

2.0.7.0

Yii2 Multi Level Marketing component

  Sources   Download

BSD

The Requires

 

The Development Requires

by Jiri Svoboda

component yii2 mlm

05/09 2017

2.0.6

2.0.6.0

Yii2 Multi Level Marketing component

  Sources   Download

BSD

The Requires

 

The Development Requires

by Jiri Svoboda

component yii2 mlm

17/07 2017

2.0.5

2.0.5.0

Yii2 Multi Level Marketing component

  Sources   Download

BSD

The Requires

 

The Development Requires

by Jiri Svoboda

component yii2 mlm

13/07 2017

2.0.4

2.0.4.0

Yii2 Multi Level Marketing component

  Sources   Download

BSD

The Requires

 

The Development Requires

by Jiri Svoboda

component yii2 mlm

13/07 2017

2.0.3

2.0.3.0

Yii2 Multi Level Marketing component

  Sources   Download

BSD

The Requires

 

The Development Requires

by Jiri Svoboda

component yii2 mlm

29/06 2017

2.0.2

2.0.2.0

Yii2 Multi Level Marketing component

  Sources   Download

BSD

The Requires

 

The Development Requires

by Jiri Svoboda

component yii2 mlm

28/06 2017

2.0.1

2.0.1.0

Yii2 Multi Level Marketing component

  Sources   Download

BSD

The Requires

 

The Development Requires

by Jiri Svoboda

component yii2 mlm

16/06 2017

2.0.0

2.0.0.0

Yii2 Multi Level Marketing component

  Sources   Download

BSD

The Requires

 

The Development Requires

by Jiri Svoboda

component yii2 mlm

24/05 2017

1.1.4

1.1.4.0

Yii2 Multi Level Marketing component

  Sources   Download

BSD

The Requires

 

by Jiri Svoboda

component yii2 mlm

16/05 2017

1.1.3

1.1.3.0

Yii2 Multi Level Marketing component

  Sources   Download

BSD

The Requires

 

by Jiri Svoboda

component yii2 mlm

01/06 2016

1.1.2

1.1.2.0

Yii2 Multi Level Marketing component

  Sources   Download

BSD

The Requires

 

by Jiri Svoboda

component yii2 mlm

07/02 2016

1.1.1

1.1.1.0

Yii2 Multi Level Marketing component

  Sources   Download

BSD

The Requires

 

by Jiri Svoboda

component yii2 mlm

07/02 2016

1.1.0

1.1.0.0

Yii2 Multi Level Marketing component

  Sources   Download

BSD

The Requires

 

by Jiri Svoboda

component yii2 mlm

10/09 2015

1.0.14

1.0.14.0

Yii2 Multi Level Marketing component

  Sources   Download

BSD

The Requires

 

by Jiri Svoboda

component yii2 mlm

04/09 2015

1.0.13

1.0.13.0

Yii2 Multi Level Marketing component

  Sources   Download

BSD

The Requires

 

by Jiri Svoboda

component yii2 mlm

30/07 2015

1.0.12

1.0.12.0

Yii2 Multi Level Marketing component

  Sources   Download

BSD

The Requires

 

by Jiri Svoboda

component yii2 mlm

03/07 2015

1.0.11

1.0.11.0

Yii2 Multi Level Marketing component

  Sources   Download

BSD

The Requires

 

by Jiri Svoboda

component yii2 mlm

03/07 2015

1.0.10

1.0.10.0

Yii2 Multi Level Marketing component

  Sources   Download

BSD

The Requires

 

by Jiri Svoboda

component yii2 mlm

29/05 2015

1.0.9

1.0.9.0

Yii2 Multi Level Marketing component

  Sources   Download

BSD

The Requires

 

by Jiri Svoboda

component yii2 mlm

29/05 2015

1.0.8

1.0.8.0

Yii2 Multi Level Marketing component

  Sources   Download

BSD

The Requires

 

by Jiri Svoboda

component yii2 mlm

28/05 2015

1.0.7

1.0.7.0

Yii2 Multi Level Marketing component

  Sources   Download

BSD

The Requires

 

by Jiri Svoboda

component yii2 mlm

26/05 2015

1.0.6

1.0.6.0

Yii2 Multi Level Marketing component

  Sources   Download

BSD

The Requires

 

by Jiri Svoboda

component yii2 mlm

21/05 2015

1.0.5

1.0.5.0

Yii2 Multi Level Marketing component

  Sources   Download

BSD

The Requires

 

by Jiri Svoboda

component yii2 mlm

20/05 2015

1.0.4

1.0.4.0

Yii2 Multi Level Marketing component

  Sources   Download

BSD

The Requires

 

by Jiri Svoboda

component yii2 mlm

19/05 2015

1.0.3

1.0.3.0

Yii2 Multi Level Marketing component

  Sources   Download

BSD

The Requires

 

by Jiri Svoboda

component yii2 mlm

18/05 2015

1.0.2

1.0.2.0

Yii2 Multi Level Marketing component

  Sources   Download

BSD

The Requires

 

by Jiri Svoboda

component yii2 mlm

16/05 2015

1.0.1

1.0.1.0

Yii2 Multi Level Marketing component

  Sources   Download

BSD

The Requires

 

by Jiri Svoboda

component yii2 mlm

13/05 2015

1.0.0

1.0.0.0

Yii2 Multi Level Marketing component

  Sources   Download

BSD

The Requires

 

by Jiri Svoboda

component yii2 mlm

01/05 2015

0.3

0.3.0.0

Yii2 Multi Level Marketing component

  Sources   Download

BSD

The Requires

 

by Jiri Svoboda

component yii2 mlm

14/04 2015

0.2

0.2.0.0

Yii2 Multi Level Marketing component

  Sources   Download

BSD

The Requires

 

by Jiri Svoboda

component yii2 mlm

11/04 2015

0.1

0.1.0.0

Yii2 Multi Level Marketing component

  Sources   Download

BSD

The Requires

 

by Jiri Svoboda

component yii2 mlm