初始版本
This commit is contained in:
60
server/app/adminapi/lists/shop/DepositPackageLists.php
Executable file
60
server/app/adminapi/lists/shop/DepositPackageLists.php
Executable file
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeshop开源商城系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee
|
||||
// | github下载:https://github.com/likeshop-github
|
||||
// | 访问官网:https://www.likeshop.cn
|
||||
// | 访问社区:https://home.likeshop.cn
|
||||
// | 访问手册:http://doc.likeshop.cn
|
||||
// | 微信公众号:likeshop技术社区
|
||||
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
|
||||
// | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
|
||||
// | 禁止对系统程序代码以任何目的,任何形式的再发布
|
||||
// | likeshop团队版权所有并拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeshop.cn.team
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\lists\shop;
|
||||
|
||||
|
||||
use app\adminapi\lists\BaseAdminDataLists;
|
||||
use app\common\model\deposit\DepositPackage;
|
||||
|
||||
class DepositPackageLists extends BaseAdminDataLists
|
||||
{
|
||||
|
||||
/**
|
||||
* @notes 列表
|
||||
* @return array
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @author ljj
|
||||
* @date 2022/2/8 3:51 下午
|
||||
*/
|
||||
public function lists(): array
|
||||
{
|
||||
$lists = (new DepositPackage())
|
||||
->order(['id'=>'desc'])
|
||||
->where(['type'=>2])
|
||||
->withoutField('update_time,delete_time')
|
||||
->select()
|
||||
->toArray();
|
||||
|
||||
return $lists;
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 服务分类数量
|
||||
* @return int
|
||||
* @author ljj
|
||||
* @date 2022/2/8 3:51 下午
|
||||
*/
|
||||
public function count(): int
|
||||
{
|
||||
return (new DepositPackage())->count();
|
||||
}
|
||||
}
|
||||
116
server/app/adminapi/lists/shop/GoodsLists.php
Executable file
116
server/app/adminapi/lists/shop/GoodsLists.php
Executable file
@@ -0,0 +1,116 @@
|
||||
<?php
|
||||
namespace app\adminapi\lists\shop;
|
||||
use app\adminapi\lists\BaseAdminDataLists;
|
||||
use app\common\enum\GoodsEnum;
|
||||
use app\common\lists\ListsExtendInterface;
|
||||
use app\common\model\goods\Goods;
|
||||
use app\common\model\goods\GoodsCategory;
|
||||
use app\common\model\shop\Shop;
|
||||
|
||||
/**
|
||||
* 服务列表
|
||||
* Class GoodsLists
|
||||
* @package app\adminapi\lists\shop
|
||||
*/
|
||||
class GoodsLists extends BaseAdminDataLists implements ListsExtendInterface
|
||||
{
|
||||
|
||||
public function setWhere()
|
||||
{
|
||||
$where = [];
|
||||
$type = $this->params['type'] ?? 0;
|
||||
switch ($type){
|
||||
case '':
|
||||
$where[] = ['audit_status','=',GoodsEnum::AUDIT_STATUS_WAIT];
|
||||
break;
|
||||
case 1:
|
||||
$where[] = ['audit_status','=',GoodsEnum::AUDIT_STATUS_REFUSE];
|
||||
break;
|
||||
case 2:
|
||||
$where[] = ['audit_status','=',GoodsEnum::AUDIT_STATUS_PASS];
|
||||
$where[] = ['status','=',GoodsEnum::SHELVE];
|
||||
break;
|
||||
case 3:
|
||||
$where[] = ['audit_status','=',GoodsEnum::AUDIT_STATUS_PASS];
|
||||
$where[] = ['status','=',GoodsEnum::UNSHELVE];
|
||||
break;
|
||||
}
|
||||
$where[] = ['shop_id','>',0];
|
||||
if(isset($this->params['name']) && $this->params['name']){
|
||||
$where[] = ['name','like','%'.$this->params['name'].'%'];
|
||||
}
|
||||
if (isset($this->params['second_id']) && $this->params['second_id']) {
|
||||
$where[] = ['category_id','=',$this->params['second_id']];
|
||||
}elseif (isset($this->params['first_id']) && $this->params['first_id']) {
|
||||
$category_lists = GoodsCategory::select()->toArray();
|
||||
$category_arr = [];
|
||||
foreach ($category_lists as $item) {
|
||||
$category_arr[$item['pid']][] = $item['id'];
|
||||
}
|
||||
$ids_arr = $category_arr[$this->params['first_id']] ?? '';
|
||||
$ids = $this->params['first_id'];
|
||||
if ($ids_arr) {
|
||||
$ids = implode(',',$ids_arr).','.$this->params['first_id'];
|
||||
}
|
||||
$where[] = ['category_id','in',$ids];
|
||||
}
|
||||
if(isset($this->params['start_time']) && $this->params['start_time']){
|
||||
$where[] = ['update_time','>',strtotime($this->params['start_time'])];
|
||||
}
|
||||
if(isset($this->params['end_time']) && $this->params['end_time']){
|
||||
$where[] = ['update_time','<',strtotime($this->params['end_time'])];
|
||||
}
|
||||
|
||||
|
||||
return $where;
|
||||
|
||||
}
|
||||
|
||||
public function lists(): array
|
||||
{
|
||||
$lists = Goods::where($this->setWhere())
|
||||
->field('id,shop_id,update_time,sort,name,image,audit_status,status,category_id,order_num,price')
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->append(['status_desc','audit_status_desc'])
|
||||
->order('id desc')
|
||||
->select()
|
||||
->toArray();
|
||||
$shopIds = array_column($lists,'shop_id');
|
||||
$categoryIds = array_column($lists,'category_id');
|
||||
$categoryLists = GoodsCategory::where(['id'=>$categoryIds])->column('name','id');
|
||||
$shopLists = Shop::where(['id'=>$shopIds])->column('name','id');
|
||||
foreach ($lists as $key => $goods){
|
||||
$lists[$key]['category_name'] = $categoryLists[$goods['category_id']] ?? '';
|
||||
$lists[$key]['shop_name'] = $shopLists[$goods['shop_id']] ?? '';
|
||||
}
|
||||
|
||||
return $lists;
|
||||
|
||||
}
|
||||
|
||||
public function count(): int
|
||||
{
|
||||
return Goods::where($this->setWhere())->count();
|
||||
}
|
||||
|
||||
public function extend()
|
||||
{
|
||||
$where = $this->setWhere();
|
||||
unset($where[0]);
|
||||
if(isset($where[1]) && 'status' == $where[1][0]){
|
||||
unset($where[1]);
|
||||
}
|
||||
$where = array_values($where);
|
||||
$waitCount = Goods::where($where)->where(['audit_status'=>GoodsEnum::AUDIT_STATUS_WAIT])->count();
|
||||
$refuseCount = Goods::where($where)->where(['audit_status'=>GoodsEnum::AUDIT_STATUS_REFUSE])->count();
|
||||
$unshelveCount = Goods::where($where)->where(['audit_status'=>GoodsEnum::AUDIT_STATUS_PASS,'status'=>GoodsEnum::UNSHELVE])->count();
|
||||
$shelveCount = Goods::where($where)->where(['audit_status'=>GoodsEnum::AUDIT_STATUS_PASS,'status'=>GoodsEnum::SHELVE])->count();
|
||||
return [
|
||||
'wait_count' => $waitCount,
|
||||
'refuse_count' => $refuseCount,
|
||||
'shelve_count' => $shelveCount,
|
||||
'unshelve_count' => $unshelveCount,
|
||||
];
|
||||
|
||||
}
|
||||
}
|
||||
80
server/app/adminapi/lists/shop/ShopApplyLists.php
Executable file
80
server/app/adminapi/lists/shop/ShopApplyLists.php
Executable file
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
namespace app\adminapi\lists\shop;
|
||||
use app\adminapi\lists\BaseAdminDataLists;
|
||||
use app\common\enum\shop\ShopEnum;
|
||||
use app\common\lists\ListsExtendInterface;
|
||||
use app\common\model\shop\Shop;
|
||||
|
||||
/**
|
||||
* 店铺申请列表
|
||||
* Class ShopApplyLists
|
||||
* @package app\adminapi\lists\shop
|
||||
*/
|
||||
class ShopApplyLists extends BaseAdminDataLists implements ListsExtendInterface
|
||||
{
|
||||
|
||||
public function setWhere()
|
||||
{
|
||||
$where = [];
|
||||
if(isset($this->params['status']) && '' != $this->params['status']){
|
||||
$where[] = ['audit_status','=',$this->params['status']];
|
||||
}
|
||||
if(isset($this->params['keyword']) && $this->params['keyword']){
|
||||
$where[] = ['sn|name','like','%'.$this->params['keyword'].'%'];
|
||||
}
|
||||
if(isset($this->params['legal_person']) && $this->params['legal_person']){
|
||||
$where[] = ['legal_person','like','%'.$this->params['legal_person'].'%'];
|
||||
}
|
||||
if(isset($this->params['start_time']) && $this->params['start_time']){
|
||||
$where[] = ['create_time','>=',$this->params['start_time']];
|
||||
}
|
||||
if(isset($this->params['end_time']) && $this->params['end_time']){
|
||||
$where[] = ['create_time','<=',$this->params['end_time']];
|
||||
}
|
||||
return $where;
|
||||
|
||||
}
|
||||
|
||||
public function lists(): array
|
||||
{
|
||||
$lists = Shop::where($this->setWhere())
|
||||
->withoutField('update_time,delete_time,longitude,latitude')
|
||||
->withCount(['goods'])
|
||||
->order('id desc')
|
||||
->append(['audit_status_desc','region_desc','province_name','city_name','region_name'])
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->select()->toArray();
|
||||
return $lists;
|
||||
|
||||
}
|
||||
|
||||
public function count(): int
|
||||
{
|
||||
return Shop::where($this->setWhere())->count();
|
||||
}
|
||||
|
||||
public function extend()
|
||||
{
|
||||
$where = $this->setWhere();
|
||||
if(isset($where[0]) && 'audit_status' == $where[0][0]){
|
||||
unset($where[0]);
|
||||
}
|
||||
$allCount = Shop::where($where)
|
||||
->count();
|
||||
$waitCount = Shop::where($where)
|
||||
->where(['audit_status'=>ShopEnum::AUDIT_STATUS_WAIT])
|
||||
->count();
|
||||
$passCount = Shop::where($where)
|
||||
->where(['audit_status'=>ShopEnum::AUDIT_STATUS_PASS])
|
||||
->count();
|
||||
$refuseCount = Shop::where($where)
|
||||
->where(['audit_status'=>ShopEnum::AUDIT_STATUS_REFUSE])
|
||||
->count();
|
||||
return [
|
||||
'all_count' => $allCount,
|
||||
'wait_count' => $waitCount,
|
||||
'pass_count' => $passCount,
|
||||
'refuse_count' => $refuseCount,
|
||||
];
|
||||
}
|
||||
}
|
||||
80
server/app/adminapi/lists/shop/ShopLists.php
Executable file
80
server/app/adminapi/lists/shop/ShopLists.php
Executable file
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
namespace app\adminapi\lists\shop;
|
||||
use app\adminapi\lists\BaseAdminDataLists;
|
||||
use app\common\enum\coach\CoachEnum;
|
||||
use app\common\enum\shop\ShopEnum;
|
||||
use app\common\model\coach\Coach;
|
||||
use app\common\model\deposit\DepositPackage;
|
||||
use app\common\model\order\Order;
|
||||
use app\common\model\shop\Shop;
|
||||
|
||||
/**
|
||||
* 店铺列表
|
||||
* Class ShopLists
|
||||
* @package app\adminapi\lists\shop
|
||||
*/
|
||||
class ShopLists extends BaseAdminDataLists
|
||||
{
|
||||
|
||||
public function setWhere()
|
||||
{
|
||||
$where = [];
|
||||
$where[] = ['audit_status','=',ShopEnum::AUDIT_STATUS_PASS];
|
||||
if(isset($this->params['keyword']) && $this->params['keyword']){
|
||||
$where[] = ['mobile|name','like','%'.$this->params['keyword'].'%'];
|
||||
}
|
||||
if(isset($this->params['legal_person']) && $this->params['legal_person']){
|
||||
$where[] = ['legal_person|sn','like','%'.$this->params['legal_person'].'%'];
|
||||
}
|
||||
if(isset($this->params['server_status']) && $this->params['server_status']){
|
||||
$where[] = ['server_status','=',$this->params['server_status']];
|
||||
}
|
||||
if(isset($this->params['type']) && $this->params['type']){
|
||||
$where[] = ['type','=',$this->params['type']];
|
||||
}
|
||||
if(isset($this->params['start_time']) && $this->params['start_time']){
|
||||
$where[] = ['create_time','>=',$this->params['start_time']];
|
||||
}
|
||||
if(isset($this->params['end_time']) && $this->params['end_time']){
|
||||
$where[] = ['create_time','<=',$this->params['end_time']];
|
||||
}
|
||||
return $where;
|
||||
|
||||
}
|
||||
|
||||
public function lists(): array
|
||||
{
|
||||
$lists = Shop::where($this->setWhere())
|
||||
->withCount(['coach'])
|
||||
->withoutField('update_time,delete_time,longitude,latitude')
|
||||
->append(['work_status_desc','server_status_desc'])
|
||||
->order('id desc')
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->select()->toArray();
|
||||
$ids = array_column($lists,'id');
|
||||
$depositLists = DepositPackage::where(['type'=>2])->order('money desc')->select()->toArray();
|
||||
$orderLists = Order::where(['shop_id'=>$ids])->field('count(id) as num,shop_id')->group('shop_id')->select()->toArray();
|
||||
$orderLists = array_column($orderLists,null,'shop_id');
|
||||
foreach ($lists as $key => $shop){
|
||||
$depositPackage = [];
|
||||
foreach ($depositLists as $deposit){
|
||||
if($shop['deposit'] >= $deposit['money']){
|
||||
$depositPackage = $deposit;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$lists[$key]['take_info'] = [
|
||||
'order_limit' => $depositPackage['order_limit'] ?? 0,
|
||||
'total_take_order' => $orderLists[$shop['id']]['num'] ?? 0,
|
||||
];
|
||||
}
|
||||
return $lists;
|
||||
|
||||
}
|
||||
|
||||
public function count(): int
|
||||
{
|
||||
return Shop::where($this->setWhere())->count();
|
||||
}
|
||||
}
|
||||
84
server/app/adminapi/lists/shop/UpdateShopLists.php
Executable file
84
server/app/adminapi/lists/shop/UpdateShopLists.php
Executable file
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
namespace app\adminapi\lists\shop;
|
||||
use app\adminapi\lists\BaseAdminDataLists;
|
||||
use app\common\enum\coach\CoachEnum;
|
||||
use app\common\enum\shop\ShopEnum;
|
||||
use app\common\lists\ListsExtendInterface;
|
||||
use app\common\model\shop\Shop;
|
||||
use app\common\model\shop\ShopUpdate;
|
||||
|
||||
class UpdateShopLists extends BaseAdminDataLists implements ListsExtendInterface
|
||||
{
|
||||
|
||||
public function setWhere()
|
||||
{
|
||||
$where = [];
|
||||
if(isset($this->params['keyword']) && $this->params['keyword']){
|
||||
$where[] = ['name|sn','like','%'.$this->params['keyword'].'%'];
|
||||
}
|
||||
if(isset($this->params['legal_keyword']) && $this->params['legal_keyword']){
|
||||
$where[] = ['legal_person|mobile','like','%'.$this->params['legal_keyword'].'%'];
|
||||
}
|
||||
if(isset($this->params['start_time']) && $this->params['start_time']){
|
||||
$where[] = ['create_time','>=',$this->params['start_time']];
|
||||
}
|
||||
if(isset($this->params['end_time']) && $this->params['end_time']){
|
||||
$where[] = ['create_time','<=',$this->params['end_time']];
|
||||
}
|
||||
return $where;
|
||||
}
|
||||
|
||||
public function lists(): array
|
||||
{
|
||||
$lists = ShopUpdate::where($this->setWhere())
|
||||
->append(['region_desc','audit_status_desc'])
|
||||
->withCount(['goods'])
|
||||
->order('id desc')
|
||||
->withoutField('update_time,delete_time')
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->select()
|
||||
->toArray();
|
||||
// $shopLists = Shop::where(['audit_status'=>ShopEnum::AUDIT_STATUS_PASS])->column('mobile','shop_id');
|
||||
// foreach ($lists as $key => $shop){
|
||||
// $lists[$key]['mobile'] = $shopLists['shop_id'] ?? '';
|
||||
// }
|
||||
|
||||
return $lists;
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 统计人数
|
||||
* @return int
|
||||
* @author cjhao
|
||||
* @date 2024/8/21 17:53
|
||||
*/
|
||||
public function count(): int
|
||||
{
|
||||
return ShopUpdate::where($this->setWhere())
|
||||
->count();
|
||||
}
|
||||
|
||||
|
||||
public function extend()
|
||||
{
|
||||
// $allCount = ShopUpdate::where($this->setWhere())
|
||||
// ->count();
|
||||
// $waitCount = ShopUpdate::where($this->setWhere())
|
||||
// ->where(['audit_status'=>CoachEnum::AUDIT_STATUS_WAIT])
|
||||
// ->count();
|
||||
// $passCount = ShopUpdate::where($this->setWhere())
|
||||
// ->where(['audit_status'=>CoachEnum::AUDIT_STATUS_PASS])
|
||||
// ->count();
|
||||
// $refuseCount = ShopUpdate::where($this->setWhere())
|
||||
// ->where($this->setWhere())
|
||||
// ->where(['audit_status'=>CoachEnum::AUDIT_STATUS_REFUSE])
|
||||
// ->count();
|
||||
// return [
|
||||
// 'all_count' => $allCount,
|
||||
// 'wait_count' => $waitCount,
|
||||
// 'pass_count' => $passCount,
|
||||
// 'refuse_count' => $refuseCount,
|
||||
// ];
|
||||
return [];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user