代理商
This commit is contained in:
10
app/agent/model/AgentPrice.php
Normal file
10
app/agent/model/AgentPrice.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace app\agent\model;
|
||||
|
||||
use fastphp\base\Model;
|
||||
|
||||
class AgentPrice extends Model
|
||||
{
|
||||
protected $table = 'agent_price';
|
||||
}
|
||||
22
app/agent/model/AgentScore.php
Normal file
22
app/agent/model/AgentScore.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace app\agent\model;
|
||||
|
||||
use fastphp\base\Model;
|
||||
|
||||
class AgentScore extends Model
|
||||
{
|
||||
protected $table = 'agent_score';
|
||||
|
||||
/**
|
||||
* 按照页数获取数据
|
||||
* @param $fields 'id,count(1)...'
|
||||
* @param $order 'id desc'/'id asc'
|
||||
* @param $limit = '100' 限制查询100条
|
||||
* $limit = '2,100' 查询第二页 100条数据
|
||||
*/
|
||||
public function getAgentListPage($where = [],$where_str = '', $fields = '*', $order = 'id desc', $limit = '50')
|
||||
{
|
||||
return $this->field($fields)->where($where)->where($where_str)->order($order)->limit($limit)->fetchAll();
|
||||
}
|
||||
}
|
||||
19
app/agent/model/Product.php
Normal file
19
app/agent/model/Product.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
/*
|
||||
* @Descripttion:
|
||||
* @version:
|
||||
* @Author: kangkang
|
||||
* @Date: 2020-10-22 16:13:41
|
||||
* @LastEditors: Please set LastEditors
|
||||
* @LastEditTime: 2020-12-03 16:28:11
|
||||
*/
|
||||
|
||||
|
||||
namespace app\agent\model;
|
||||
|
||||
use fastphp\base\Model;
|
||||
|
||||
class Product extends Model
|
||||
{
|
||||
protected $table = 'product';
|
||||
}
|
||||
31
app/agent/model/ProductAccount.php
Normal file
31
app/agent/model/ProductAccount.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
/*
|
||||
* @Descripttion:
|
||||
* @version:
|
||||
* @Author: kangkang
|
||||
* @Date: 2020-10-22 16:13:41
|
||||
* @LastEditors: Please set LastEditors
|
||||
* @LastEditTime: 2020-12-03 16:28:11
|
||||
*/
|
||||
|
||||
|
||||
namespace app\agent\model;
|
||||
|
||||
use fastphp\base\Model;
|
||||
|
||||
class ProductAccount extends Model
|
||||
{
|
||||
protected $table = 'product_account';
|
||||
|
||||
/**
|
||||
* 按照页数获取数据
|
||||
* @param $fields 'id,count(1)...'
|
||||
* @param $order 'id desc'/'id asc'
|
||||
* @param $limit = '100' 限制查询100条
|
||||
* $limit = '2,100' 查询第二页 100条数据
|
||||
*/
|
||||
public function getAgentListPage($where = [],$where_str = '', $fields = '*', $order = 'id desc', $limit = '50')
|
||||
{
|
||||
return $this->field($fields)->where($where)->where($where_str)->order($order)->limit($limit)->fetchAll();
|
||||
}
|
||||
}
|
||||
31
app/agent/model/ProductOrder.php
Normal file
31
app/agent/model/ProductOrder.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
/*
|
||||
* @Descripttion:
|
||||
* @version:
|
||||
* @Author: kangkang
|
||||
* @Date: 2020-10-22 16:13:41
|
||||
* @LastEditors: Please set LastEditors
|
||||
* @LastEditTime: 2020-12-03 16:28:11
|
||||
*/
|
||||
|
||||
|
||||
namespace app\agent\model;
|
||||
|
||||
use fastphp\base\Model;
|
||||
|
||||
class ProductOrder extends Model
|
||||
{
|
||||
protected $table = 'product_order';
|
||||
|
||||
/**
|
||||
* 按照页数获取数据
|
||||
* @param $fields 'id,count(1)...'
|
||||
* @param $order 'id desc'/'id asc'
|
||||
* @param $limit = '100' 限制查询100条
|
||||
* $limit = '2,100' 查询第二页 100条数据
|
||||
*/
|
||||
public function getAgentListPage($where = [],$where_str = '', $fields = '*', $order = 'id desc', $limit = '50')
|
||||
{
|
||||
return $this->field($fields)->where($where)->where($where_str)->order($order)->limit($limit)->fetchAll();
|
||||
}
|
||||
}
|
||||
19
app/agent/model/ProductPackage.php
Normal file
19
app/agent/model/ProductPackage.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
/*
|
||||
* @Descripttion:
|
||||
* @version:
|
||||
* @Author: kangkang
|
||||
* @Date: 2020-10-22 16:13:41
|
||||
* @LastEditors: Please set LastEditors
|
||||
* @LastEditTime: 2020-12-03 16:28:11
|
||||
*/
|
||||
|
||||
|
||||
namespace app\agent\model;
|
||||
|
||||
use fastphp\base\Model;
|
||||
|
||||
class ProductPackage extends Model
|
||||
{
|
||||
protected $table = 'product_package';
|
||||
}
|
||||
10
app/agent/model/ProductUserPrice.php
Normal file
10
app/agent/model/ProductUserPrice.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace app\agent\model;
|
||||
|
||||
use fastphp\base\Model;
|
||||
|
||||
class ProductUserPrice extends Model
|
||||
{
|
||||
protected $table = 'product_user_price';
|
||||
}
|
||||
@@ -19,4 +19,9 @@ class User extends Model
|
||||
{
|
||||
return $this->field($fields)->where($where)->fetch();
|
||||
}
|
||||
|
||||
//获取代理商的用户数量
|
||||
public function getAgentUser($where = []){
|
||||
return $this->field('agent_id,count(1) as num')->where($where)->group(['agent_id'])->fetchAll();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user