pull/1/head
wangmingchuan321@qq.com 10 months ago
commit a9a16ed9df
  1. 174
      app/admin/controller/Goods.php
  2. 4
      app/admin/controller/Store.php
  3. 13
      app/api/controller/Recovery.php
  4. 2
      app/api/model/RecoveryOrder.php
  5. 5
      app/common/model/Category.php
  6. 6
      app/common/model/RecoveryOrder.php
  7. 6
      config/app.php
  8. 2
      public/admin/config.js
  9. 1
      public/admin/css/chunk-vendors.23cf87cf.css
  10. 1
      public/admin/css/chunk-vendors.c8ce63df.css
  11. 1
      public/admin/css/menu.bd0a1218.css
  12. 1
      public/admin/css/menu.eaad26a9.css
  13. 2
      public/admin/index.html
  14. 2
      public/admin/js/app.6de5d359.js
  15. 4
      public/admin/js/menu.51d0dd02.js
  16. 3
      public/admin/js/store.619afaa0.js
  17. 3
      public/admin/js/store.e34e83e7.js

@ -41,165 +41,39 @@ class Goods extends Controller
*/
public function index(): Json
{
$list = Db::connect("dataCenterMysql")->table('goods_sku')
->order('update_time desc')
->paginate(15);
return $this->renderSuccess(compact('list'));
}
/**
* 获取商城登录token
* @param int $storeId
* @return Json
*/
public function superLogin(int $storeId): Json
{
// 获取指定商城的管理员用户信息
$userInfo = StoreUserService::getUserInfoByStoreId($storeId);
if (empty($userInfo)) {
return $this->renderError('未找到该商城管理员用户');
$params = $this->request->param();
$sort = $this->request->param('sort', 'id');
$order = $this->request->param('order', 'desc');
$where = [];
if (isset($params['channel']) && $params['channel']) {
$where[] = ['channel', '=', $params['channel']];
}
// 登录商户后台
$token = StoreUserService::login($userInfo->toArray());
return $this->renderSuccess([
'userId' => $userInfo['store_user_id'],
'token' => $token
]);
}
/**
* 回收站列表
* @return Json
* @throws \think\db\exception\DbException
*/
public function recycle(): Json
{
// 商城列表
$model = new StoreModel;
$list = $model->getList(true);
return $this->renderSuccess(compact('list'));
}
/**
* 新增商城
* @return Json
*/
public function add(): Json
{
// 新增记录
$model = new StoreModel;
if ($model->add($this->postForm())) {
return $this->renderSuccess('添加成功');
if (isset($params['min_profit_rate']) && $params['min_profit_rate']) {
$where[] = ['profit_rate', '>=', $params['min_profit_rate']];
}
return $this->renderError($model->getError() ?: '添加失败');
}
/**
* 移入回收站
* @param int $storeId
* @return Json
*/
public function recovery(int $storeId): Json
{
// 商城详情
$model = StoreModel::detail($storeId);
if (!$model->recycle()) {
return $this->renderError($model->getError() ?: '操作失败');
if (isset($params['max_profit_rate']) && $params['max_profit_rate']) {
$where[] = ['profit_rate', '<=', $params['max_profit_rate']];
}
return $this->renderSuccess('操作成功');
}
/**
* 移出回收站
* @param int $storeId
* @return Json
*/
public function move(int $storeId): Json
{
// 商城详情
$model = StoreModel::detail($storeId);
if (!$model->recycle(false)) {
return $this->renderError($model->getError() ?: '操作失败');
}
return $this->renderSuccess('操作成功');
}
/**
* 删除商城
* @param int $storeId
* @return Json
*/
public function delete(int $storeId): Json
{
// 商城详情
$model = StoreModel::detail($storeId);
if (!$model->setDelete()) {
return $this->renderError($model->getError() ?: '操作失败');
if (isset($params['min_price']) && $params['min_price']) {
$where[] = ['net_price', '>=', $params['min_price']];
}
return $this->renderSuccess('操作成功');
}
/**
* 审核商城
* @param int $storeId
* @return Json
*/
public function audit(int $storeId): Json
{
// 商城详情
$model = StoreModel::detail($storeId);
if (!$model->auditStore($this->request->param())) {
return $this->renderError($model->getError() ?: '操作失败');
if (isset($params['max_price']) && $params['max_price']) {
$where[] = ['net_price', '<=', $params['max_price']];
}
return $this->renderSuccess('操作成功');
}
/**
* 审核商城
* @param int $storeId
* @return Json
*/
public function platformList(): Json
{
$platformList = [
'sn' => "苏宁"
];
return $this->renderSuccess($platformList);
}
/**
* 审核商城
* @param int $storeId
* @return Json
*/
public function getStorePlatform(int $storeId): Json
{
$list = SyncTask::where("store_id", $storeId)->order('create_time desc')->select()->toArray();
return $this->renderSuccess($list);
$list = Db::connect("dataCenterMysql")->table('goods_sku')
->where($where)
->order($sort." ".$order)
->paginate($this->request->param('per_page', 15))->each(function ($item, $key){
$item['create_time'] = date("Y-m-d H:i:s", $item['create_time']);
$item['update_time'] = date("Y-m-d H:i:s", $item['update_time']);
$item['channel'] = config('app.platformList')[$item['channel']] ?? "";
return $item;
});
return $this->renderSuccess(compact('list'));
}
/**
* 审核商城
* @param int $storeId
* @return Json
*/
public function auth(int $storeId): Json
{
SyncTask::where('store_id', $storeId)->delete();
$platformList = $this->request->param('platformList');
$inData = [];
foreach ($platformList as $value) {
$inData[] = [
'store_id' => $storeId,
'channel' => $value,
'create_time' => time(),
];
}
$model = new SyncTask;
$model->addAll($inData);
return $this->renderSuccess('操作成功');
}

@ -162,9 +162,7 @@ class Store extends Controller
*/
public function platformList(): Json
{
$platformList = [
'sn' => "苏宁"
];
$platformList = config('app.platformList');
return $this->renderSuccess($platformList);
}
/**

@ -89,10 +89,23 @@ class Recovery extends Controller
$data['list'] = $list->items();
$data['total'] = $list->total();
if ($data['total']) {
$recovery_id = array_column($data['list'], 'recovery_id');
$model = new ServerRecovery();
$recovery_list = $model->whereIn('recovery_id', $recovery_id)
->with(['image'])
->select()
->toArray();
$image_list = [];
if ($recovery_list) {
$image_list = array_column($recovery_list, 'recovery_image', 'recovery_id');
}
foreach ($data['list'] as $key => $value) {
$data['list'][$key]['is_cancel'] = 0;
$data['list'][$key]['is_success'] = 0;
$data['list'][$key]['recovery_image'] = !empty($image_list[$value['recovery_id']]) ?: '';
if ($value['order_status'] == RecoveryStatusEnum::ACCEPTED) {
$data['list'][$key]['is_cancel'] = 1;
$data['list'][$key]['is_success'] = 1;
}
}
}

@ -38,7 +38,7 @@ class RecoveryOrder extends BaseRecoveryOrder
$where = array_merge($where, ['user_id' => $userId]);
}
//分销商工程师
return $this->where($where)
return $this
->where($where)
->order(['create_time' => 'desc'])
->paginate($listRows);

@ -13,8 +13,8 @@ declare (strict_types=1);
namespace app\common\model;
use cores\BaseModel;
use think\model\relation\HasOne;
use think\model\relation\HasMany;
use think\model\relation\HasOne;
/**
* 商品分类模型
@ -86,8 +86,9 @@ class Category extends BaseModel
// 设置检索条件
$filter = [];
$params['status'] > -1 && $filter[] = ['status', '=', $params['status']];
if (!empty($_GET['is_hot']) && $_GET['is_hot'] == 1) {
$filter[] = ['is_hot','=',1];
$filter[] = ['is_hot', '=', $params['is_hot']];
}
// 查询列表数据

@ -3,6 +3,7 @@ declare (strict_types=1);
namespace app\common\model;
use app\api\model\Server\ServerRecovery;
use app\common\enum\RecoveryStatusEnum;
use app\common\enum\RecoveryTypeEnum;
use cores\BaseModel;
@ -33,6 +34,11 @@ class RecoveryOrder extends BaseModel
return $this->hasMany(RecoveryImage::class, 'order_id', 'order_id')->order(['id']);
}
public function recovery()
{
$this->hasOne(ServerRecovery::class, 'recovery_id', 'recovery_id');
}
public function getOrderStatusTextAttr($value, $data)
{
$result = RecoveryStatusEnum::data();

@ -39,4 +39,10 @@ return [
'error_message' => '页面错误!请稍后再试~',
// 显示错误信息
'show_error_msg' => true,
'platformList' => [
'sn' => "苏宁",
'jd' => "京东",
'tb' => "淘宝",
'pdd' => "拼多多",
],
];

@ -1,6 +1,6 @@
window.serverConfig = {
// 系统名称
APP_NAME: 'saas',
APP_NAME: '萤火商城系统2.0',
// 必填: api地址, 换成自己的域名即可
// 例如: https://www.你的域名.com/index.php?s=/admin
BASE_API: 'https://www.saas.njrenzhou.com/index.php?s=/admin',

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -0,0 +1 @@
.ant-tag[data-v-669d76dd]{cursor:pointer}.ant-tag[data-v-669d76dd]:hover{border:1px solid #fb9a9a;color:#fb9a9a}.formContent[data-v-7befcb3a]{display:-webkit-box;display:-ms-flexbox;display:flex;margin-bottom:10px}.formContent .formItem[data-v-7befcb3a]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.formContent .formItem .formTitle[data-v-7befcb3a]{display:inline-block;width:70px;text-align:right;margin-right:10px}

@ -1 +0,0 @@
.ant-tag[data-v-669d76dd]{cursor:pointer}.ant-tag[data-v-669d76dd]:hover{border:1px solid #fb9a9a;color:#fb9a9a}

@ -1 +1 @@
<!DOCTYPE html><html lang="zh-cmn-Hans"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>超级管理后台</title><style>#loading-mask{position:fixed;left:0;top:0;height:100%;width:100%;background:#fff;user-select:none;z-index:9999;overflow:hidden}.loading-wrapper{position:absolute;top:50%;left:50%;transform:translate(-50%,-100%)}.loading-dot{animation:antRotate 1.2s infinite linear;transform:rotate(45deg);position:relative;display:inline-block;font-size:64px;width:64px;height:64px;box-sizing:border-box}.loading-dot i{width:22px;height:22px;position:absolute;display:block;background-color:#1890ff;border-radius:100%;transform:scale(.75);transform-origin:50% 50%;opacity:.3;animation:antSpinMove 1s infinite linear alternate}.loading-dot i:nth-child(1){top:0;left:0}.loading-dot i:nth-child(2){top:0;right:0;-webkit-animation-delay:.4s;animation-delay:.4s}.loading-dot i:nth-child(3){right:0;bottom:0;-webkit-animation-delay:.8s;animation-delay:.8s}.loading-dot i:nth-child(4){bottom:0;left:0;-webkit-animation-delay:1.2s;animation-delay:1.2s}@keyframes antRotate{to{-webkit-transform:rotate(405deg);transform:rotate(405deg)}}@-webkit-keyframes antRotate{to{-webkit-transform:rotate(405deg);transform:rotate(405deg)}}@keyframes antSpinMove{to{opacity:1}}@-webkit-keyframes antSpinMove{to{opacity:1}}</style><link href="css/cloud.0422aa4a.css" rel="prefetch"><link href="css/menu.eaad26a9.css" rel="prefetch"><link href="css/setting.13b2d651.css" rel="prefetch"><link href="css/store.bbb0f5dd.css" rel="prefetch"><link href="css/user.a645b22a.css" rel="prefetch"><link href="js/cloud.7bbfae1c.js" rel="prefetch"><link href="js/fail.306fabae.js" rel="prefetch"><link href="js/menu.c38e4099.js" rel="prefetch"><link href="js/setting.4766d8b5.js" rel="prefetch"><link href="js/store.619afaa0.js" rel="prefetch"><link href="js/user.8986244d.js" rel="prefetch"><link href="css/app.9fd2da7c.css" rel="preload" as="style"><link href="css/chunk-vendors.c8ce63df.css" rel="preload" as="style"><link href="js/app.b4cbc23b.js" rel="preload" as="script"><link href="js/chunk-vendors.597463c4.js" rel="preload" as="script"><link href="css/chunk-vendors.c8ce63df.css" rel="stylesheet"><link href="css/app.9fd2da7c.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but vue-antd-pro doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"><div id="loading-mask"><div class="loading-wrapper"><span class="loading-dot loading-dot-spin"><i></i><i></i><i></i><i></i></span></div></div></div><script src="config.js"></script><script src="js/chunk-vendors.597463c4.js"></script><script src="js/app.b4cbc23b.js"></script></body></html>
<!DOCTYPE html><html lang="zh-cmn-Hans"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>超级管理后台</title><style>#loading-mask{position:fixed;left:0;top:0;height:100%;width:100%;background:#fff;user-select:none;z-index:9999;overflow:hidden}.loading-wrapper{position:absolute;top:50%;left:50%;transform:translate(-50%,-100%)}.loading-dot{animation:antRotate 1.2s infinite linear;transform:rotate(45deg);position:relative;display:inline-block;font-size:64px;width:64px;height:64px;box-sizing:border-box}.loading-dot i{width:22px;height:22px;position:absolute;display:block;background-color:#1890ff;border-radius:100%;transform:scale(.75);transform-origin:50% 50%;opacity:.3;animation:antSpinMove 1s infinite linear alternate}.loading-dot i:nth-child(1){top:0;left:0}.loading-dot i:nth-child(2){top:0;right:0;-webkit-animation-delay:.4s;animation-delay:.4s}.loading-dot i:nth-child(3){right:0;bottom:0;-webkit-animation-delay:.8s;animation-delay:.8s}.loading-dot i:nth-child(4){bottom:0;left:0;-webkit-animation-delay:1.2s;animation-delay:1.2s}@keyframes antRotate{to{-webkit-transform:rotate(405deg);transform:rotate(405deg)}}@-webkit-keyframes antRotate{to{-webkit-transform:rotate(405deg);transform:rotate(405deg)}}@keyframes antSpinMove{to{opacity:1}}@-webkit-keyframes antSpinMove{to{opacity:1}}</style><link href="css/cloud.0422aa4a.css" rel="prefetch"><link href="css/menu.bd0a1218.css" rel="prefetch"><link href="css/setting.13b2d651.css" rel="prefetch"><link href="css/store.bbb0f5dd.css" rel="prefetch"><link href="css/user.a645b22a.css" rel="prefetch"><link href="js/cloud.7bbfae1c.js" rel="prefetch"><link href="js/fail.306fabae.js" rel="prefetch"><link href="js/menu.51d0dd02.js" rel="prefetch"><link href="js/setting.4766d8b5.js" rel="prefetch"><link href="js/store.e34e83e7.js" rel="prefetch"><link href="js/user.8986244d.js" rel="prefetch"><link href="css/app.9fd2da7c.css" rel="preload" as="style"><link href="css/chunk-vendors.23cf87cf.css" rel="preload" as="style"><link href="js/app.6de5d359.js" rel="preload" as="script"><link href="js/chunk-vendors.597463c4.js" rel="preload" as="script"><link href="css/chunk-vendors.23cf87cf.css" rel="stylesheet"><link href="css/app.9fd2da7c.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but vue-antd-pro doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"><div id="loading-mask"><div class="loading-wrapper"><span class="loading-dot loading-dot-spin"><i></i><i></i><i></i><i></i></span></div></div></div><script src="config.js"></script><script src="js/chunk-vendors.597463c4.js"></script><script src="js/app.6de5d359.js"></script></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save