eugene-kei / yii2-micro-school-crm

适用于舞蹈学校、体育俱乐部等的小型CRM系统。


README

舞蹈学校、体育俱乐部、儿童兴趣小组等的应用程序模板。

小型CRM系统,可管理客户支付和已付款课程。

应用程序是用php框架Yii 2编写的。

通用功能

  • 管理客户支付和已付款课程。

  • 添加和删除客户。

  • 创建学员组。

  • 为学员组设置课程表。

  • 设置会员卡(价格、课程数量和会员卡“有效期”)。

  • 在为客户付款时自动计算已付款课程。这些数据基于已设置的组、课程表和会员卡。

  • 允许客户透支支付。

  • 查看所有欠款人。

  • 查看哪些客户支付了特定课程。

  • 查看客户的每次支付和所有已付款课程。

  • 在更改课程表时,客户已付款的课程数据会自动更新。

  • 可以在特定日期取消一个或多个组的课程。如果客户已付款的课程,则它们会自动转移到同一组中最近的未付款日期。

  • 有两个级别的合作伙伴计划。可以在管理后台启用/禁用合作伙伴计划。可以设置第一和第二级别的佣金,以及应发放的最低付款金额。奖金积分可以用于支付部分或全部会员卡。每个用户在个人资料中的“个人信息”选项卡中都有一个合作伙伴链接(如果合作伙伴计划已激活),他们可以与朋友分享等。所有通过合作伙伴链接注册的用户都会被计算,并且从他们的每次付款中都会收取一定的佣金。还可以在管理员面板中创建客户时设置佣金。

  • 查看支付统计(仅限于校长和超级管理员)。

客户(用户)功能

用户 - 网站上已认证的用户。他可以访问个人资料。

查看和更改个人资料。

查看每次付款的历史记录和已付款课程。

查看剩余的已付款课程(日期、时间和课程名称)。

管理员(admin)功能

管理员可以访问客户、付款、日程安排和组的数据,并且可以发布网站新闻。

管理员可以访问管理后台,包括客户、付款、日程安排和组的数据。

校长(director)功能

校长可以做管理员能做的所有事情,还可以设置会员卡、合作伙伴计划、学校联系信息以及访问支付统计。

###超级管理员(superadmin)功能 超级管理员可以做上述所有事情,并且可以访问权限设置(RBAC)。

安装

使用Composer进行安装。

执行以下命令

composer global require "fxp/composer-asset-plugin:~1.0.0"
composer create-project --prefer-dist eugene-kei/yii2-micro-school-crm yii2-micro-school-crm

第一个命令将安装composer asset plugin

它允许通过composer管理包依赖项中的bower和npm。这只需要做一次。

第二个命令将应用yi2-micro-school-crm安装到yi2-micro-school-crm目录中。如果需要,您可以更改目录名称。

准备应用程序

应用安装完成后,需要执行以下操作进行初始化。

1. 执行 init 命令,并选择 dev 模式以开发应用程序。

php /path/to/yii-application/init

或者,对于生产环境,以非交互模式执行 init 命令。

php /path/to/yii-application/init --env=Production --overwrite=All

2. 创建数据库,并在文件 common/config/main-local.php 中设置相应的 components['db'] 参数。

3. 在控制台中执行以下命令以应用迁移

yii migrate - 应用应用程序的通用迁移;

yii migrate --migrationPath=@eugenekei/news/migrations - 应用模块 eugene-kei/yii2-simple-news 的迁移。

4. 配置您的 Web 服务器 document roots

  • 对于前端 /path/to/yii2-micro-school-crm/frontend/web/ 并使用 URL http://frontend.dev/

  • 对于后端 /path/to/yii2-micro-school-crm/backend/web/ 并使用 URL http://backend.dev/

对于 Apache,可能如下所示

   <VirtualHost *:80>
       ServerName frontend.dev
       ServerAlias 127.0.0.1
       DocumentRoot /path/to/yii2-micro-school-crm/frontend/web/
       
       <Directory "/path/to/yii2-micro-school-crm/frontend/web/">
           # use mod_rewrite for pretty URL support
           RewriteEngine on
           # If a directory or a file exists, use the request directly
           RewriteCond %{REQUEST_FILENAME} !-f
           RewriteCond %{REQUEST_FILENAME} !-d
           # Otherwise forward the request to index.php
           RewriteRule . index.php
       
           # ...other settings...
       </Directory>
   </VirtualHost>
   
   <VirtualHost *:80>
       ServerName backend.dev
       ServerAlias 127.0.0.1
       DocumentRoot /path/to/yii2-micro-school-crm/backend/web/
       
       <Directory "/path/to/yii2-micro-school-crm/backend/web/">
           # use mod_rewrite for pretty URL support
           RewriteEngine on
           # If a directory or a file exists, use the request directly
           RewriteCond %{REQUEST_FILENAME} !-f
           RewriteCond %{REQUEST_FILENAME} !-d
           # Otherwise forward the request to index.php
           RewriteRule . index.php
       
           # ...other settings...
       </Directory>
   </VirtualHost>

对于 nginx

   server {
       charset utf-8;
       client_max_body_size 128M;
   
       listen 80; ## listen for ipv4
       #listen [::]:80 default_server ipv6only=on; ## listen for ipv6
   
       server_name frontend.dev;
       root        /path/to/yii2-micro-school-crm/frontend/web/;
       index       index.php;
   
       access_log  /path/to/yii2-micro-school-crm/log/frontend-access.log;
       error_log   /path/to/yii2-micro-school-crm/frontend-error.log;
   
       location / {
           # Redirect everything that isn't a real file to index.php;
           try_files $uri $uri/ /index.php?$args;
       }
   
       # uncomment to avoid processing of calls to non-existing static files by Yii
       #location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ {
       #    try_files $uri =404;
       #}
       #error_page 404 /404.html;
   
       location ~ \.php$ {
           include fastcgi_params;
           fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
           fastcgi_pass   127.0.0.1:9000;
           #fastcgi_pass unix:/var/run/php5-fpm.sock;
           try_files $uri =404;
       }
   
       location ~ /\.(ht|svn|git) {
           deny all;
       }
   }
    
   server {
       charset utf-8;
       client_max_body_size 128M;
   
       listen 80; ## listen for ipv4
       #listen [::]:80 default_server ipv6only=on; ## listen for ipv6
   
       server_name backend.dev;
       root        /path/to/yii2-micro-school-crm/backend/web/;
       index       index.php;
   
       access_log  /path/to/yii2-micro-school-crm/log/backend-access.log;
       error_log   /path/to/yii2-micro-school-crm/log/backend-error.log;
   
       location / {
           # Redirect everything that isn't a real file to index.php
           try_files $uri $uri/ /index.php?$args;
       }
   
       # uncomment to avoid processing of calls to non-existing static files by Yii
       #location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ {
       #    try_files $uri =404;
       #}
       #error_page 404 /404.html;
   
       location ~ \.php$ {
           include fastcgi_params;
           fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
           fastcgi_pass   127.0.0.1:9000;
           #fastcgi_pass unix:/var/run/php5-fpm.sock;
           try_files $uri =404;
       }
   
       location ~ /\.(ht|svn|git) {
           deny all;
       }
   }

5. 打开 hosts 文件

  • Windows: c:\Windows\System32\Drivers\etc\hosts
  • Linux: /etc/hosts

并在其中添加以下行

   127.0.0.1   frontend.dev
   
   127.0.0.1   backend.dev

应用安装后,其中已注册 1 个具有超级管理员权限的用户。

用户名(电话) - 123456

密码 - 123456

要更改密码,请通过地址 http://frontend.dev/site/request-password-reset/ 订单重置密码,在管理员界面中先更改邮箱。

依赖关系

应用程序 yii2-micro-school-crm 是基于应用程序模板 yii2-app-advanced 编写的。

安装说明主要来自那里。

依赖关系列表

    "php": ">=5.4.0",
    "yiisoft/yii2": ">=2.0.4",
    "yiisoft/yii2-bootstrap": "*",
    "yiisoft/yii2-swiftmailer": "*",
    "mdmsoft/yii2-admin": "1.*",
    "dmstr/yii2-adminlte-asset": "2.*",
    "eugene-kei/yii2-simple-news": "*",
    "kartik-v/yii2-grid": "*",
    "kartik-v/yii2-editable": "*",
    "kartik-v/yii2-date-range": "*",
    "kartik-v/yii2-widget-datepicker": "*",
    "kartik-v/yii2-widget-select2": "*",
    "kartik-v/yii2-widget-switchinput": "*",
    "kartik-v/yii2-widget-depdrop": "@dev",
    "kartik-v/yii2-widget-sidenav": "*",
    "vova07/yii2-fileapi-widget": "*",
    "2amigos/yii2-chartjs-widget": "~2.0",
    "nesbot/carbon": "1.*"