其余文件
This commit is contained in:
41
app/shop/controller/distribution/Center.php
Normal file
41
app/shop/controller/distribution/Center.php
Normal file
@ -0,0 +1,41 @@
|
||||
<?php
|
||||
namespace app\shop\controller\distribution;
|
||||
|
||||
use app\common\basics\ShopBase;
|
||||
use app\common\server\JsonServer;
|
||||
use app\common\model\distribution\DistributionOrderGoods;
|
||||
use app\shop\logic\distribution\CenterLogic;
|
||||
|
||||
class Center extends ShopBase
|
||||
{
|
||||
public function data()
|
||||
{
|
||||
// 已结算: 已结算
|
||||
$settled = DistributionOrderGoods::where([
|
||||
['status', '=', '2'],
|
||||
['shop_id', '=', $this->shop_id]
|
||||
])->sum('money');
|
||||
|
||||
|
||||
// 预估: 待返佣 + 已结算
|
||||
$estimate = DistributionOrderGoods::where([
|
||||
['status', 'in', [1, 2]],
|
||||
['shop_id', '=', $this->shop_id]
|
||||
])->sum('money');
|
||||
return view('', [
|
||||
'settled' => $settled,
|
||||
'estimate' => $estimate
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 分销概况
|
||||
* @author Tab
|
||||
* @date 2021/9/3 15:53
|
||||
*/
|
||||
public function center()
|
||||
{
|
||||
$data = CenterLogic::center($this->shop_id);
|
||||
return view('', ['data' => $data]);
|
||||
}
|
||||
}
|
||||
73
app/shop/controller/distribution/Goods.php
Normal file
73
app/shop/controller/distribution/Goods.php
Normal file
@ -0,0 +1,73 @@
|
||||
<?php
|
||||
namespace app\shop\controller\distribution;
|
||||
|
||||
use app\common\basics\ShopBase;
|
||||
use app\admin\logic\goods\CategoryLogic as MallCategoryLogic;
|
||||
use app\common\server\JsonServer;
|
||||
use app\shop\logic\distribution\GoodsLogic;
|
||||
use app\shop\logic\goods\CategoryLogic as ShopCategoryLogic;
|
||||
|
||||
class Goods extends ShopBase
|
||||
{
|
||||
/**
|
||||
* @notes 分销商品列表页
|
||||
* @return \think\response\View
|
||||
* @author Tab
|
||||
* @date 2021/9/1 17:11
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
if ($this->request->isPost()) {
|
||||
$params = $this->request->post();
|
||||
$params['shop_id'] = $this->shop_id;
|
||||
$lists = GoodsLogic::lists($params);
|
||||
return JsonServer::success('', $lists);
|
||||
}
|
||||
// 显示分销商品列表页
|
||||
$cate_list = MallCategoryLogic::categoryTreeeTree();
|
||||
$shop_cate_list = ShopCategoryLogic::listAll($this->shop_id);
|
||||
return view('', [
|
||||
'cate_list' => $cate_list,
|
||||
'shop_cate_list' => $shop_cate_list
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 设置佣金
|
||||
* @return \think\response\View
|
||||
* @author Tab
|
||||
* @date 2021/9/1 19:59
|
||||
*/
|
||||
public function set()
|
||||
{
|
||||
if ($this->request->isPost()) {
|
||||
$params = $this->request->post();
|
||||
$params['shop_id'] = $this->shop_id;
|
||||
$result = GoodsLogic::set($params);
|
||||
if ($result) {
|
||||
return JsonServer::success('设置成功');
|
||||
}
|
||||
return JsonServer::error(GoodsLogic::getError());
|
||||
}
|
||||
$params = $this->request->get();
|
||||
$detail = GoodsLogic::detail($params);
|
||||
return view('', ['detail' => $detail]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 参与分销/取消分销
|
||||
* @return \think\response\Json
|
||||
* @author Tab
|
||||
* @date 2021/9/2 10:03
|
||||
*/
|
||||
public function isDistribution()
|
||||
{
|
||||
$params = $this->request->post();
|
||||
$params['shop_id'] = $this->shop_id;
|
||||
$result = GoodsLogic::isDistribution($params);
|
||||
if ($result) {
|
||||
return JsonServer::success('操作成功');
|
||||
}
|
||||
return JsonServer::error(GoodsLogic::getError());
|
||||
}
|
||||
}
|
||||
27
app/shop/controller/distribution/Order.php
Normal file
27
app/shop/controller/distribution/Order.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
namespace app\shop\controller\distribution;
|
||||
|
||||
use app\common\basics\ShopBase;
|
||||
use app\common\server\JsonServer;
|
||||
use app\shop\logic\distribution\OrderLogic;
|
||||
|
||||
|
||||
class Order extends ShopBase
|
||||
{
|
||||
/**
|
||||
* @notes 分销订单列表
|
||||
* @return \think\response\View
|
||||
* @author Tab
|
||||
* @date 2021/9/3 14:38
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
if($this->request->isPost()) {
|
||||
$params = $this->request->post();
|
||||
$params['shop_id'] = $this->shop_id;
|
||||
$result = OrderLogic::lists($params);
|
||||
return JsonServer::success('', $result);
|
||||
}
|
||||
return view();
|
||||
}
|
||||
}
|
||||
23
app/shop/controller/distribution/Record.php
Normal file
23
app/shop/controller/distribution/Record.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
namespace app\shop\controller\distribution;
|
||||
|
||||
use app\shop\logic\distribution\RecordLogic;
|
||||
use app\common\basics\ShopBase;
|
||||
use app\common\server\JsonServer;
|
||||
use app\common\utils\Time;
|
||||
|
||||
class Record extends ShopBase
|
||||
{
|
||||
public function lists()
|
||||
{
|
||||
if($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$get['shop_id'] = $this->shop_id;
|
||||
$data = RecordLogic::lists($get);
|
||||
return JsonServer::success('', $data);
|
||||
}
|
||||
return view('', [
|
||||
'time' => Time::getTime()
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user