diff --git a/crmeb/app/adminapi/controller/v1/agent/AgentManage.php b/crmeb/app/adminapi/controller/v1/agent/AgentManage.php index 7decf21f9..0383da60e 100644 --- a/crmeb/app/adminapi/controller/v1/agent/AgentManage.php +++ b/crmeb/app/adminapi/controller/v1/agent/AgentManage.php @@ -60,7 +60,7 @@ class AgentManage extends AuthController public function get_badge() { $where = $this->request->getMore([ - ['data', ''], + ['data', '', '', 'time'], ['nickname', ''], ]); return app('json')->success(['res' => $this->services->getSpreadBadge($where)]); diff --git a/crmeb/app/adminapi/controller/v1/agent/Division.php b/crmeb/app/adminapi/controller/v1/agent/Division.php index cbdc965ca..50cf1baa5 100644 --- a/crmeb/app/adminapi/controller/v1/agent/Division.php +++ b/crmeb/app/adminapi/controller/v1/agent/Division.php @@ -121,19 +121,24 @@ class Division extends AuthController * 保存代理商 * @param UserServices $userServices * @return mixed + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException */ public function divisionAgentSave(UserServices $userServices) { $data = $this->request->postMore([ + ['division_id', 0], ['uid', 0], ['division_percent', 0], ['division_end_time', ''], ['division_status', 1], ['edit', 0], ]); - $userInfo = $userServices->get((int)$data['uid']); + $userInfo = $userServices->count(['uid' => (int)$data['uid']]); if (!$userInfo) throw new AdminException(100100); - $data['division_id'] = $this->adminInfo['division_id']; + $divisionUserInfo = $userServices->count(['uid' => (int)$data['division_id'], 'is_division' => 1, 'division_id' => $data['division_id']]); + if (!$divisionUserInfo) throw new AdminException(100100); $this->services->divisionAgentSave($data); return app('json')->success(100000); } diff --git a/crmeb/app/adminapi/controller/v1/export/ExportExcel.php b/crmeb/app/adminapi/controller/v1/export/ExportExcel.php index 0fc03b224..3dd393675 100644 --- a/crmeb/app/adminapi/controller/v1/export/ExportExcel.php +++ b/crmeb/app/adminapi/controller/v1/export/ExportExcel.php @@ -72,7 +72,8 @@ class ExportExcel extends AuthController ['label_id', ''], ['now_money', 'normal'], ['field_key', ''], - ['isMember', ''] + ['isMember', ''], + ['ids', []] ]); return app('json')->success($this->service->exportUserList($where)); } diff --git a/crmeb/app/adminapi/controller/v1/user/UserLabel.php b/crmeb/app/adminapi/controller/v1/user/UserLabel.php index 034fc7736..f61f4077f 100644 --- a/crmeb/app/adminapi/controller/v1/user/UserLabel.php +++ b/crmeb/app/adminapi/controller/v1/user/UserLabel.php @@ -37,7 +37,11 @@ class UserLabel extends AuthController /** * 标签列表 + * @param int $label_cate * @return mixed + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException */ public function index($label_cate = 0) { @@ -60,8 +64,10 @@ class UserLabel extends AuthController /** * 保存标签表单数据 - * @param int $id * @return mixed + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException */ public function save() { diff --git a/crmeb/app/adminapi/route/product.php b/crmeb/app/adminapi/route/product.php index 9ede94a54..d73d2a0b9 100644 --- a/crmeb/app/adminapi/route/product.php +++ b/crmeb/app/adminapi/route/product.php @@ -15,6 +15,7 @@ Route::group('product', function () { Route::get('category', 'v1.product.StoreCategory/index')->option(['real_name' => '商品分类列表']); //商品树形列表 Route::get('category/tree/:type', 'v1.product.StoreCategory/tree_list')->option(['real_name' => '商品分类树形列表']); + Route::get('category/cascader/:type', 'v1.product.StoreCategory/cascader_list')->option(['real_name' => '商品分类树形列表']); //商品分类新增表单 Route::get('category/create', 'v1.product.StoreCategory/create')->option(['real_name' => '商品分类新增表单']); //商品分类新增 diff --git a/crmeb/app/api/controller/v1/PublicController.php b/crmeb/app/api/controller/v1/PublicController.php index 7581def83..e820356b2 100644 --- a/crmeb/app/api/controller/v1/PublicController.php +++ b/crmeb/app/api/controller/v1/PublicController.php @@ -657,4 +657,31 @@ class PublicController { return app('json')->success(app()->make(LangCodeServices::class)->getLangVersion()); } + + /** + * 商城基础配置汇总接口 + * @return \think\Response + * @author 吴汐 + * @email 442384644@qq.com + * @date 2023/04/03 + */ + public function getMallBasicConfig() + { + $data['site_name'] = sys_config('site_name');//网站名称 + $data['site_url'] = sys_config('site_url');//网站地址 + $data['wap_login_logo'] = sys_config('wap_login_logo');//移动端登录logo + $data['wap_login_logo'] = sys_config('wap_login_logo');//移动端登录logo + $data['record_No'] = sys_config('record_No');//备案号 + $data['network_security'] = sys_config('network_security');//网安备案 + $data['store_self_mention'] = sys_config('store_self_mention');//是否开启到店自提 + $data['invoice_func_status'] = sys_config('invoice_func_status');//发票功能启用 + $data['special_invoice_status'] = sys_config('special_invoice_status');//专用发票启用 + $data['member_func_status'] = sys_config('member_func_status');//用户等级启用 + $data['balance_func_status'] = sys_config('balance_func_status');//余额功能启用 + $data['recharge_switch'] = sys_config('recharge_switch');//小程序充值开关 + $data['member_card_status'] = sys_config('member_card_status');//是否开启付费会员 + $data['member_price_status'] = sys_config('member_price_status');//商品会员折扣价展示启用 + + return app('json')->success($data); + } } diff --git a/crmeb/app/api/controller/v1/admin/StoreOrderController.php b/crmeb/app/api/controller/v1/admin/StoreOrderController.php index f966fd6c4..17ab9ec7d 100644 --- a/crmeb/app/api/controller/v1/admin/StoreOrderController.php +++ b/crmeb/app/api/controller/v1/admin/StoreOrderController.php @@ -238,7 +238,7 @@ class StoreOrderController $start = $middle; } $space = bcsub($stop, $start, 0);//间隔时间段 - $front = bcsub($start, $space, 0);//第一个时间段 + $front = bcsub($start, $space, 0) - 1;//第一个时间段 /** @var StoreOrderServices $orderService */ $orderService = app()->make(StoreOrderServices::class); $order_where = [ @@ -246,10 +246,11 @@ class StoreOrderController 'paid' => 1, 'refund_status' => [0, 3], 'is_del' => 0, - 'is_system_del' => 0]; + 'is_system_del' => 0 + ]; if ($type == 1) {//销售额 - $frontPrice = $orderService->sum($order_where + ['time' => [$front, $start]], 'pay_price', true); + $frontPrice = $orderService->sum($order_where + ['time' => [$front, $start - 1]], 'pay_price', true); $afterPrice = $orderService->sum($order_where + ['time' => [$start, $stop]], 'pay_price', true); $chartInfo = $orderService->chartTimePrice($start, $stop); $data['chart'] = $chartInfo;//营业额图表数据 @@ -262,7 +263,7 @@ class StoreOrderController $data['increase_time'] = abs($increase); //同比上个时间区间增长营业额 $data['increase_time_status'] = $increase >= 0 ? 1 : 2; //同比上个时间区间增长营业额增长 1 减少 2 } else {//订单数 - $frontNumber = $orderService->count($order_where + ['time' => [$front, $start]]); + $frontNumber = $orderService->count($order_where + ['time' => [$front, $start - 1]]); $afterNumber = $orderService->count($order_where + ['time' => [$start, $stop]]); $chartInfo = $orderService->chartTimeNumber($start, $stop); $data['chart'] = $chartInfo;//订单数图表数据 diff --git a/crmeb/app/api/controller/v1/order/StoreOrderController.php b/crmeb/app/api/controller/v1/order/StoreOrderController.php index 40643831f..82ed1573e 100644 --- a/crmeb/app/api/controller/v1/order/StoreOrderController.php +++ b/crmeb/app/api/controller/v1/order/StoreOrderController.php @@ -94,6 +94,10 @@ class StoreOrderController * @param Request $request * @param ShippingTemplatesServices $services * @return mixed + * @throws \Psr\SimpleCache\InvalidArgumentException + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException */ public function confirm(Request $request, ShippingTemplatesServices $services) { @@ -297,23 +301,6 @@ class StoreOrderController } } - /** - * TODO 支付宝单独支付 弃用 - * @param OrderPayServices $payServices - * @param OtherOrderServices $services - * @param string $key - * @param string $quitUrl - * @return mixed - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\DbException - * @throws \think\db\exception\ModelNotFoundException - */ -// public function aliPay(OrderPayServices $payServices, OtherOrderServices $services, string $key, string $quitUrl) -// { -// $payInfo = $this->services->aliPayOrder($payServices, $services, $key, $quitUrl); -// return app('json')->success(['pay_content' => $payInfo]); -// } - /** * 订单列表 * @param Request $request @@ -467,8 +454,14 @@ class StoreOrderController /** * 订单 查看物流 * @param Request $request + * @param StoreOrderCartInfoServices $services + * @param ExpressServices $expressServices * @param $uni + * @param string $type * @return mixed + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException */ public function express(Request $request, StoreOrderCartInfoServices $services, ExpressServices $expressServices, $uni, $type = '') { @@ -484,6 +477,7 @@ class StoreOrderController foreach ($order['cart_info'] as $k => $cart) { $cartNew['cart_num'] = $cart['cart_num']; $cartNew['truePrice'] = $cart['truePrice']; + $cartNew['postage_price'] = $cart['postage_price']; $cartNew['productInfo']['image'] = $cart['productInfo']['image']; $cartNew['productInfo']['store_name'] = $cart['productInfo']['store_name']; $cartNew['productInfo']['unit_name'] = $cart['productInfo']['unit_name'] ?? ''; @@ -507,6 +501,7 @@ class StoreOrderController $cart = json_decode($cart, true); $cartNew['cart_num'] = $cart['cart_num']; $cartNew['truePrice'] = $cart['truePrice']; + $cartNew['postage_price'] = $cart['postage_price']; $cartNew['productInfo']['image'] = $cart['productInfo']['image']; $cartNew['productInfo']['store_name'] = $cart['productInfo']['store_name']; $cartNew['productInfo']['unit_name'] = $cart['productInfo']['unit_name'] ?? ''; @@ -535,6 +530,7 @@ class StoreOrderController * @param Request $request * @param StoreOrderCartInfoServices $cartInfoServices * @param StoreProductReplyServices $replyServices + * @return \think\Response|void * @throws \Psr\SimpleCache\InvalidArgumentException */ public function comment(Request $request, StoreOrderCartInfoServices $cartInfoServices, StoreProductReplyServices $replyServices) @@ -728,37 +724,6 @@ class StoreOrderController return app('json')->fail(100028); } - /** - * 订单申请退款审核 - * @param Request $request - * @param StoreOrderRefundServices $services - */ - public function refund_verify(Request $request, StoreOrderRefundServices $services) - { -// $data = $request->postMore([ -// ['text', ''], -// ['refund_reason_wap_img', ''], -// ['refund_reason_wap_explain', ''], -// ['uni', ''], -// ['refund_type', 1], -// ['cart_id', 0], -// ['refund_num', 0] -// ]); -// $uni = $data['uni']; -// unset($data['uni']); -// if ($data['refund_reason_wap_img'] != '') { -// $data['refund_reason_wap_img'] = explode(',', $data['refund_reason_wap_img']); -// } else { -// $data['refund_reason_wap_img'] = []; -// } -// if (!$uni || $data['text'] == '' || $data['refund_num'] <= 0) return app('json')->fail('参数错误!'); -// $res = $services->orderApplyRefund($this->services->getUserOrderDetail($uni, (int)$request->uid()), $data['text'], $data['refund_reason_wap_explain'], $data['refund_reason_wap_img'], $data['refund_type'], $data['cart_id'], $data['refund_num']); -// if ($res) -// return app('json')->success('提交申请成功'); -// else -// return app('json')->fail('提交失败'); - } - /** * 用户退货提交快递单号 * @param Request $request diff --git a/crmeb/app/dao/BaseDao.php b/crmeb/app/dao/BaseDao.php index d1e69ece7..9ad15edbf 100644 --- a/crmeb/app/dao/BaseDao.php +++ b/crmeb/app/dao/BaseDao.php @@ -47,6 +47,7 @@ abstract class BaseDao * 读取数据条数 * @param array $where * @return int + * @throws \ReflectionException */ public function count(array $where = []) { @@ -59,8 +60,10 @@ abstract class BaseDao * @param string $field * @param int $page * @param int $limit + * @param string $order * @param bool $search * @return \think\Collection + * @throws \ReflectionException * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException @@ -304,13 +307,14 @@ abstract class BaseDao $with = []; $otherWhere = []; $responses = new \ReflectionClass($this->setModel()); + foreach ($where as $key => $value) { $method = 'search' . Str::studly($key) . 'Attr'; if ($responses->hasMethod($method)) { $with[] = $key; } else { - if ($key != 'timeKey') { - $otherWhere[] = $value; + if (!in_array($key, ['timeKey', 'store_stock', 'integral_time'])) { + $otherWhere[] = is_array($value) ? $value : [$key, '=', $value]; } } } @@ -320,6 +324,7 @@ abstract class BaseDao /** * 根据搜索器获取搜索内容 * @param $where + * @param $search * @return BaseModel * @throws \ReflectionException * @author 吴汐 @@ -378,6 +383,9 @@ abstract class BaseDao * @param string|null $keyField * @param int $acc * @return bool + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException */ public function bcInc($key, string $incField, string $inc, string $keyField = null, int $acc = 2) { @@ -392,6 +400,9 @@ abstract class BaseDao * @param string|null $keyField * @param int $acc * @return bool + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException */ public function bcDec($key, string $decField, string $dec, string $keyField = null, int $acc = 2) { @@ -458,18 +469,6 @@ abstract class BaseDao })->dec($stock, $num)->inc($sales, $num)->update(); } return false; -// $field = $isQuota ? [$stock, $sales, 'quota'] : [$stock, $sales]; -// $info = $this->getModel()->where($where)->field($field)->find(); -// if ($info) { -// if ($isQuota) { -// $info->quota = (int)$info->quota - $num; -// } -// $info->stock = (int)$info->stock - $num; -// $info->sales = (int)$info->sales + $num; -// return $info->save(); -// } else { -// return false; -// } } /** @@ -500,22 +499,6 @@ abstract class BaseDao })->inc($stock, $num)->dec($sales, $salesNum)->update(); } return true; -// $field = $isQuota ? [$stock, $sales, 'quota'] : [$stock, $sales]; -// $info = $this->getModel()->where($where)->field($field)->find(); -// if ($info) { -// if ($isQuota) { -// $info->quota = (int)$info->quota + $num; -// } -// $info->stock = (int)$info->stock + $num; -// if ((int)$info->sales > $num) { -// $info->sales = (int)$info->sales - $num; -// } else { -// $info->sales = 0; -// } -// return $info->save(); -// } else { -// return false; -// } } /** diff --git a/crmeb/app/dao/activity/bargain/StoreBargainUserDao.php b/crmeb/app/dao/activity/bargain/StoreBargainUserDao.php index de82d3d7c..31f48bf64 100644 --- a/crmeb/app/dao/activity/bargain/StoreBargainUserDao.php +++ b/crmeb/app/dao/activity/bargain/StoreBargainUserDao.php @@ -104,8 +104,11 @@ class StoreBargainUserDao extends BaseDao */ public function bargainUserList($where, $page = 0, $limit = 0) { - return $this->search($where)->with(['getBargain', 'getUser'])->when($page != 0, function ($query) use ($page, $limit) { - $query->page($page, $limit); - })->order('add_time desc')->select()->toArray(); + return $this->search($where)->with(['getBargain', 'getUser']) + ->when(isset($where['real_name']) && $where['real_name'] != '', function ($query) use ($where) { + $query->where('uid', $where['real_name']); + })->when($page != 0, function ($query) use ($page, $limit) { + $query->page($page, $limit); + })->order('add_time desc')->select()->toArray(); } } diff --git a/crmeb/app/dao/order/StoreOrderDao.php b/crmeb/app/dao/order/StoreOrderDao.php index cbefd5a5d..703c88d6b 100644 --- a/crmeb/app/dao/order/StoreOrderDao.php +++ b/crmeb/app/dao/order/StoreOrderDao.php @@ -933,7 +933,7 @@ class StoreOrderDao extends BaseDao return $this->search($where)->where('seckill_id', $id) ->when($page && $limit, function ($query) use ($page, $limit) { $query->page($page, $limit); - })->field(['order_id', 'real_name', 'status', 'pay_price', 'total_num', 'add_time', 'pay_time', 'paid'])->select()->toArray(); + })->field(['order_id', 'real_name', 'status', 'pay_price', 'total_num', 'add_time', 'pay_time', 'paid'])->order('add_time desc')->select()->toArray(); } /** @@ -952,7 +952,7 @@ class StoreOrderDao extends BaseDao return $this->search($where)->where('bargain_id', $id) ->when($page && $limit, function ($query) use ($page, $limit) { $query->page($page, $limit); - })->field(['order_id', 'real_name', 'status', 'pay_price', 'total_num', 'add_time', 'pay_time', 'paid'])->select()->toArray(); + })->field(['uid', 'order_id', 'real_name', 'status', 'pay_price', 'total_num', 'add_time', 'pay_time', 'paid'])->order('add_time desc')->select()->toArray(); } /** @@ -968,7 +968,7 @@ class StoreOrderDao extends BaseDao */ public function combinationStatisticsOrder($id, $where, $page = 0, $limit = 0) { - return $this->search($where)->where('combination_id', $id)->where('paid', 1)->whereIn('refund_type', [0, 3])->where('is_del', 0) + return $this->search($where)->where('combination_id', $id) ->when($page && $limit, function ($query) use ($page, $limit) { $query->page($page, $limit); })->field(['uid', 'order_id', 'real_name', 'status', 'pay_price', 'total_num', 'add_time', 'pay_time', 'paid'])->order('add_time desc')->select()->toArray(); diff --git a/crmeb/app/dao/product/product/StoreCategoryDao.php b/crmeb/app/dao/product/product/StoreCategoryDao.php index 03bcbff59..cbe034902 100644 --- a/crmeb/app/dao/product/product/StoreCategoryDao.php +++ b/crmeb/app/dao/product/product/StoreCategoryDao.php @@ -45,7 +45,9 @@ class StoreCategoryDao extends BaseDao /** * * @param array $where + * @param array $field * @return array + * @throws \ReflectionException * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException @@ -59,6 +61,7 @@ class StoreCategoryDao extends BaseDao * 添加修改选择上级分类列表 * @param array $where * @return array + * @throws \ReflectionException */ public function getMenus(array $where) { diff --git a/crmeb/app/dao/product/product/StoreProductDao.php b/crmeb/app/dao/product/product/StoreProductDao.php index 0048a885d..61eefcc97 100644 --- a/crmeb/app/dao/product/product/StoreProductDao.php +++ b/crmeb/app/dao/product/product/StoreProductDao.php @@ -63,7 +63,9 @@ class StoreProductDao extends BaseDao * @param array $where * @param int $page * @param int $limit + * @param string $order * @return array + * @throws \ReflectionException * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException @@ -71,7 +73,7 @@ class StoreProductDao extends BaseDao public function getList(array $where, int $page = 0, int $limit = 0, string $order = '') { $prefix = Config::get('database.connections.' . Config::get('database.default') . '.prefix'); - return $this->search($where)->order(($order ? $order . ' ,' : '') . 'sort desc,id desc') + return $this->search($where, false)->order(($order ? $order . ' ,' : '') . 'sort desc,id desc') ->when($page != 0 && $limit != 0, function ($query) use ($page, $limit) { $query->page($page, $limit); })->field([ @@ -79,7 +81,6 @@ class StoreProductDao extends BaseDao '(SELECT count(*) FROM `' . $prefix . 'store_product_relation` WHERE `product_id` = `' . $prefix . 'store_product`.`id` AND `type` = \'collect\') as collect', '(SELECT count(*) FROM `' . $prefix . 'store_product_relation` WHERE `product_id` = `' . $prefix . 'store_product`.`id` AND `type` = \'like\') as likes', '(SELECT SUM(stock) FROM `' . $prefix . 'store_product_attr_value` WHERE `product_id` = `' . $prefix . 'store_product`.`id` AND `type` = 0) as stock', -// '(SELECT SUM(sales) FROM `' . $prefix . 'store_product_attr_value` WHERE `product_id` = `' . $prefix . 'store_product`.`id` AND `type` = 0) as sales', '(SELECT count(*) FROM `' . $prefix . 'store_visit` WHERE `product_id` = `' . $prefix . 'store_product`.`id` AND `product_type` = \'product\') as visitor', ])->select()->toArray(); } diff --git a/crmeb/app/dao/user/UserDao.php b/crmeb/app/dao/user/UserDao.php index 715374a5c..3c5a74a39 100644 --- a/crmeb/app/dao/user/UserDao.php +++ b/crmeb/app/dao/user/UserDao.php @@ -176,6 +176,7 @@ class UserDao extends BaseDao * 获取推广员ids * @param array $where * @return array + * @throws \ReflectionException */ public function getAgentUserIds(array $where) { diff --git a/crmeb/app/dao/user/UserWechatUserDao.php b/crmeb/app/dao/user/UserWechatUserDao.php index 20cddac5b..914c86641 100644 --- a/crmeb/app/dao/user/UserWechatUserDao.php +++ b/crmeb/app/dao/user/UserWechatUserDao.php @@ -244,6 +244,10 @@ class UserWechatUserDao extends BaseDao if (isset($where['is_del'])) { $model->where($userAlias . 'is_del', $where['is_del']); } + + if (isset($where['ids']) && count($where['ids'])) { + $model->whereIn($userAlias . 'uid', $where['ids']); + } return $field ? $model->field($field) : $model; } diff --git a/crmeb/app/model/product/product/StoreProduct.php b/crmeb/app/model/product/product/StoreProduct.php index 432a59843..36728afdc 100644 --- a/crmeb/app/model/product/product/StoreProduct.php +++ b/crmeb/app/model/product/product/StoreProduct.php @@ -326,8 +326,6 @@ class StoreProduct extends BaseModel $query->whereIn('id', function ($query) use ($store_stock) { $query->name('store_product_attr_value')->where('stock', '<', $store_stock)->where('stock', '>', 0)->where('type', 0)->field('product_id')->select(); }); -// $query->where(['is_show' => 1, 'is_del' => 0])->where('stock', '<=', $store_stock)->where('stock', '>', 0); - } else { $query->where(['is_show' => 1, 'is_del' => 0])->where('stock', '>', 0); } diff --git a/crmeb/app/services/activity/bargain/StoreBargainServices.php b/crmeb/app/services/activity/bargain/StoreBargainServices.php index 38858a92a..bf18fcf9e 100644 --- a/crmeb/app/services/activity/bargain/StoreBargainServices.php +++ b/crmeb/app/services/activity/bargain/StoreBargainServices.php @@ -996,8 +996,8 @@ class StoreBargainServices extends BaseServices $spread_count = $bargainUserHelp->count(['bargain_id' => $id, 'type' => 0]); $start_count = $bargainUser->count(['bargain_id' => $id]); $success_count = $bargainUser->count(['bargain_id' => $id, 'status' => 3]); - $pay_price = $orderServices->sum(['bargain_id' => $id, 'paid' => 1], 'pay_price', true); - $pay_count = $orderServices->count(['bargain_id' => $id, 'paid' => 1]); + $pay_price = $orderServices->sum([['bargain_id', '=', $id], ['paid', '=', 1], ['refund_type', 'in', [0, 3]], ['is_del', '=', 0]], 'pay_price', false); + $pay_count = $orderServices->getDistinctCount([['bargain_id', '=', $id], ['paid', '=', 1], ['refund_type', 'in', [0, 3]], ['is_del', '=', 0]], 'uid', false); $pay_rate = $start_count > 0 ? bcmul(bcdiv((string)$pay_count, (string)$start_count, 2), '100', 2) : 0; return compact('people_count', 'spread_count', 'start_count', 'success_count', 'pay_price', 'pay_count', 'pay_rate'); } @@ -1027,6 +1027,7 @@ class StoreBargainServices extends BaseServices /** @var StoreOrderServices $orderServices */ $orderServices = app()->make(StoreOrderServices::class); [$page, $limit] = $this->getPageValue(); + $where = $where + ['paid' => 1, 'refund_status' => 0, 'is_del' => 0]; $list = $orderServices->bargainStatisticsOrder($id, $where, $page, $limit); $where['bargain_id'] = $id; $count = $orderServices->count($where); diff --git a/crmeb/app/services/activity/bargain/StoreBargainUserServices.php b/crmeb/app/services/activity/bargain/StoreBargainUserServices.php index 6c196f3f4..570e6167a 100644 --- a/crmeb/app/services/activity/bargain/StoreBargainUserServices.php +++ b/crmeb/app/services/activity/bargain/StoreBargainUserServices.php @@ -234,6 +234,9 @@ class StoreBargainUserServices extends BaseServices * 砍价列表 * @param $where * @return array + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException */ public function bargainUserList($where) { diff --git a/crmeb/app/services/activity/combination/StoreCombinationServices.php b/crmeb/app/services/activity/combination/StoreCombinationServices.php index 4e2115fff..6a01a7456 100644 --- a/crmeb/app/services/activity/combination/StoreCombinationServices.php +++ b/crmeb/app/services/activity/combination/StoreCombinationServices.php @@ -660,6 +660,7 @@ class StoreCombinationServices extends BaseServices /** @var StoreOrderServices $orderServices */ $orderServices = app()->make(StoreOrderServices::class); [$page, $limit] = $this->getPageValue(); + $where = $where + ['paid' => 1, 'refund_status' => 0, 'is_del' => 0]; $list = $orderServices->combinationStatisticsOrder($id, $where, $page, $limit); $where['combination_id'] = $id; $count = $orderServices->count($where); diff --git a/crmeb/app/services/activity/coupon/StoreCouponService.php b/crmeb/app/services/activity/coupon/StoreCouponService.php index 6a0932717..c816cf6f6 100644 --- a/crmeb/app/services/activity/coupon/StoreCouponService.php +++ b/crmeb/app/services/activity/coupon/StoreCouponService.php @@ -71,7 +71,7 @@ class StoreCouponService extends BaseServices $f[] = Form::select('category_id', '选择品类')->setOptions(Form::setOptions($options))->filterable(1)->col(12); break; case 2://商品券 - $f[] = Form::frameImages('image', '商品', Url::buildUrl('admin/store.StoreProduct/index', array('fodder' => 'image', 'type' => 'many')))->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true])->props(['srcKey' => 'image']); + $f[] = Form::frameImages('image', '商品', Url::buildUrl(config('app.admin_prefix', 'admin') . '/store.StoreProduct/index', array('fodder' => 'image', 'type' => 'many')))->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true])->props(['srcKey' => 'image']); $f[] = Form::hidden('product_id', ''); break; } diff --git a/crmeb/app/services/activity/live/LiveRoomServices.php b/crmeb/app/services/activity/live/LiveRoomServices.php index a5f03b14a..64c23ce29 100644 --- a/crmeb/app/services/activity/live/LiveRoomServices.php +++ b/crmeb/app/services/activity/live/LiveRoomServices.php @@ -242,6 +242,7 @@ class LiveRoomServices extends BaseServices /** * 同步直播间状态 * @return bool + * @throws \Exception */ public function syncRoomStatus() { @@ -249,7 +250,6 @@ class LiveRoomServices extends BaseServices $limit = 50; $data = $dataAll = []; $rooms = $this->dao->getColumn([], 'id,room_id,live_status', 'room_id'); -// if (!$rooms) return true; do { $wxRooms = MiniProgramService::getLiveInfo($start, $limit); foreach ($wxRooms as $room) { diff --git a/crmeb/app/services/activity/seckill/StoreSeckillServices.php b/crmeb/app/services/activity/seckill/StoreSeckillServices.php index 1bcf9c782..b47a78054 100644 --- a/crmeb/app/services/activity/seckill/StoreSeckillServices.php +++ b/crmeb/app/services/activity/seckill/StoreSeckillServices.php @@ -775,7 +775,7 @@ class StoreSeckillServices extends BaseServices /** @var StoreOrderServices $orderServices */ $orderServices = app()->make(StoreOrderServices::class); [$page, $limit] = $this->getPageValue(); - $where['is_del'] = 0; + $where = $where + ['paid' => 1, 'refund_status' => 0, 'is_del' => 0]; $list = $orderServices->seckillOrder($id, $where, $page, $limit); $where['seckill_id'] = $id; $count = $orderServices->count($where); diff --git a/crmeb/app/services/agent/DivisionServices.php b/crmeb/app/services/agent/DivisionServices.php index cfdb5a65a..ddcfab914 100644 --- a/crmeb/app/services/agent/DivisionServices.php +++ b/crmeb/app/services/agent/DivisionServices.php @@ -222,9 +222,11 @@ class DivisionServices extends BaseServices if ($uid && !$userInfo) throw new AdminException(400214); $field = []; if ($uid) { + $field[] = Form::number('division_id', '事业部UID', $userInfo['division_id'] ?? '')->disabled(true)->style(['width' => '173px']); $field[] = Form::number('uid', '用户UID', $userInfo['uid'] ?? '')->disabled(true)->style(['width' => '173px']); $field[] = Form::hidden('edit', 1); } else { + $field[] = Form::number('division_id', '事业部UID')->style(['width' => '173px']); $field[] = Form::number('uid', '用户UID')->style(['width' => '173px']); $field[] = Form::hidden('edit', 0); } @@ -238,20 +240,24 @@ class DivisionServices extends BaseServices * 保存代理商 * @param $data * @return bool + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException */ public function divisionAgentSave($data) { /** @var UserServices $userServices */ $userServices = app()->make(UserServices::class); $uid = $data['uid']; - $userInfo = $userServices->getUserInfo($uid, 'is_division,division_id,agent_id'); $agentData = [ + 'division_id' => $data['division_id'], 'division_status' => $data['division_status'], 'division_percent' => $data['division_percent'], 'division_change_time' => time(), 'division_end_time' => strtotime($data['division_end_time']), + 'division_type' => 2, ]; - $division_info = $userServices->getUserInfo($userInfo['division_id'], 'division_end_time,division_percent'); + $division_info = $userServices->getUserInfo($data['division_id'], 'division_end_time,division_percent'); if ($division_info) { if ($agentData['division_percent'] > $division_info['division_percent']) throw new AdminException(400448); if ($agentData['division_end_time'] > $division_info['division_end_time']) throw new AdminException(400449); diff --git a/crmeb/app/services/kefu/LoginServices.php b/crmeb/app/services/kefu/LoginServices.php index 56e383870..f5d527145 100644 --- a/crmeb/app/services/kefu/LoginServices.php +++ b/crmeb/app/services/kefu/LoginServices.php @@ -64,6 +64,7 @@ class LoginServices extends BaseServices $token = $this->createToken($kefuInfo->id, 'kefu'); $kefuInfo->update_time = time(); $kefuInfo->ip = request()->ip(); + $kefuInfo->online = 1; $kefuInfo->save(); return [ 'token' => $token['token'], diff --git a/crmeb/app/services/kefu/service/StoreServiceLogServices.php b/crmeb/app/services/kefu/service/StoreServiceLogServices.php index 527ab9cb4..7bbe381f0 100644 --- a/crmeb/app/services/kefu/service/StoreServiceLogServices.php +++ b/crmeb/app/services/kefu/service/StoreServiceLogServices.php @@ -120,7 +120,7 @@ class StoreServiceLogServices extends BaseServices foreach ($list as &$item) { $item['_add_time'] = $item['add_time']; $item['add_time'] = strtotime($item['_add_time']); - $item['productInfo'] = $item['orderInfo'] = []; + $item['productInfo'] = $item['orderInfo'] = null; if ($item['msn_type'] == self::MSN_TYPE_GOODS && $item['msn']) { $productIds[] = $item['msn']; } elseif ($item['msn_type'] == self::MSN_TYPE_ORDER && $item['msn']) { @@ -155,7 +155,7 @@ class StoreServiceLogServices extends BaseServices foreach ($list as &$item) { if ($item['msn_type'] == self::MSN_TYPE_GOODS && $item['msn']) { - $item['productInfo'] = $productList[$item['msn']] ?? []; + $item['productInfo'] = $productList[$item['msn']] ?? null; } elseif ($item['msn_type'] == self::MSN_TYPE_ORDER && $item['msn']) { $order = $orderInfo[$item['msn']] ?? null; if ($order) { @@ -164,7 +164,7 @@ class StoreServiceLogServices extends BaseServices $order['add_time_h'] = date('H:i:s', $order['add_time']); $item['orderInfo'] = $order; } else { - $item['orderInfo'] = []; + $item['orderInfo'] = null; } } $item['msn_type'] = (int)$item['msn_type']; diff --git a/crmeb/app/services/kefu/service/StoreServiceServices.php b/crmeb/app/services/kefu/service/StoreServiceServices.php index 1fff5a725..1b92148a5 100644 --- a/crmeb/app/services/kefu/service/StoreServiceServices.php +++ b/crmeb/app/services/kefu/service/StoreServiceServices.php @@ -93,7 +93,7 @@ class StoreServiceServices extends BaseServices if ($formData) { $field[] = $this->builder->frameImage('avatar', '客服头像', $this->url(config('app.admin_prefix', 'admin') . '/widget.images/index', ['fodder' => 'avatar'], true), $formData['avatar'] ?? '')->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true]); } else { - $field[] = $this->builder->frameImage('image', '选择用户', $this->url('admin/system.user/list', ['fodder' => 'image'], true))->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true])->Props(['srcKey' => 'image']); + $field[] = $this->builder->frameImage('image', '选择用户', $this->url(config('app.admin_prefix', 'admin') . '/system.user/list', ['fodder' => 'image'], true))->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true])->Props(['srcKey' => 'image']); $field[] = $this->builder->hidden('uid', 0); $field[] = $this->builder->hidden('avatar', ''); } diff --git a/crmeb/app/services/order/DeliveryServiceServices.php b/crmeb/app/services/order/DeliveryServiceServices.php index a04fe051e..7349f3998 100644 --- a/crmeb/app/services/order/DeliveryServiceServices.php +++ b/crmeb/app/services/order/DeliveryServiceServices.php @@ -82,7 +82,7 @@ class DeliveryServiceServices extends BaseServices if ($formData) { $field[] = $this->builder->frameImage('avatar', '配送员头像', $this->url(config('app.admin_prefix', 'admin') . '/widget.images/index', ['fodder' => 'avatar'], true), $formData['avatar'] ?? '')->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true]); } else { - $field[] = $this->builder->frameImage('image', '商城用户', $this->url('admin/system.user/list', ['fodder' => 'image'], true))->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true])->Props(['srcKey' => 'image']); + $field[] = $this->builder->frameImage('image', '商城用户', $this->url(config('app.admin_prefix', 'admin') . '/system.user/list', ['fodder' => 'image'], true))->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true])->Props(['srcKey' => 'image']); $field[] = $this->builder->hidden('uid', 0); $field[] = $this->builder->hidden('avatar', ''); } diff --git a/crmeb/app/services/order/StoreOrderRefundServices.php b/crmeb/app/services/order/StoreOrderRefundServices.php index b0926ab9c..9acc00b13 100644 --- a/crmeb/app/services/order/StoreOrderRefundServices.php +++ b/crmeb/app/services/order/StoreOrderRefundServices.php @@ -245,7 +245,7 @@ class StoreOrderRefundServices extends BaseServices $this->storeOrderServices->update($splitOrderInfo['id'], [ 'status' => -2, 'refund_status' => 2, - 'refund_type' => $orderRefundInfo['refund_type'], + 'refund_type' => 6, 'refund_express' => $orderRefundInfo['refund_express'], 'refund_express_name' => $orderRefundInfo['refund_express_name'], 'refund_reason_wap_img' => $orderRefundInfo['refund_img'], diff --git a/crmeb/app/services/order/StoreOrderServices.php b/crmeb/app/services/order/StoreOrderServices.php index 2872f002c..3b01ce3f9 100644 --- a/crmeb/app/services/order/StoreOrderServices.php +++ b/crmeb/app/services/order/StoreOrderServices.php @@ -1420,10 +1420,17 @@ HTML; return bcmul(bcdiv((bcsub($nowValue, $lastValue, 2)), $lastValue, 4), 100, 2); } + /** + * 后台首页顶部统计 + * @return array + * @author 吴汐 + * @email 442384644@qq.com + * @date 2023/04/03 + */ public function homeStatics() { - /** @var UserServices $uSercice */ - $uSercice = app()->make(UserServices::class); + /** @var UserServices $userService */ + $userService = app()->make(UserServices::class); /** @var StoreProductLogServices $productLogServices */ $productLogServices = app()->make(StoreProductLogServices::class); //TODO 销售额 @@ -1433,22 +1440,12 @@ HTML; $yesterday_sales = $this->dao->todaySales('yesterday'); //日同比 $sales_today_ratio = $this->growth($today_sales, $yesterday_sales); -// //周销售额 -// //本周 -// $this_week_sales = $this->dao->thisWeekSales('week'); -// //上周 -// $last_week_sales = $this->dao->thisWeekSales('last week'); -// //周同比 -// $sales_week_ratio = $this->growth($this_week_sales, $last_week_sales); //总销售额 $total_sales = $this->dao->totalSales('month'); $sales = [ 'today' => $today_sales, 'yesterday' => $yesterday_sales, 'today_ratio' => $sales_today_ratio, -// 'week' => $this_week_sales, -// 'last_week' => $last_week_sales, -// 'week_ratio' => $sales_week_ratio, 'total' => $total_sales . '元', 'date' => '今日' ]; @@ -1459,21 +1456,12 @@ HTML; $yesterday_visits = $productLogServices->count(['time' => 'yesterday', 'type' => 'visit']); //日同比 $visits_today_ratio = $this->growth($today_visits, $yesterday_visits); -// //本周访问量 -// $this_week_visits = $productLogServices->count(['time' => 'week', 'type' => 'visit']); -// //上周访问量 -// $last_week_visits = $productLogServices->count(['time' => 'last week', 'type' => 'visit']); -// //周同比 -// $visits_week_ratio = $this->growth($this_week_visits, $last_week_visits); //总访问量 $total_visits = $productLogServices->count(['time' => 'month', 'type' => 'visit']); $visits = [ 'today' => $today_visits, 'yesterday' => $yesterday_visits, 'today_ratio' => $visits_today_ratio, -// 'week' => $this_week_visits, -// 'last_week' => $last_week_visits, -// 'week_ratio' => $visits_week_ratio, 'total' => $total_visits . 'Pv', 'date' => '今日' ]; @@ -1484,46 +1472,28 @@ HTML; $yesterday_order = $this->dao->todayOrderVisit('yesterday', 1); //订单日同比 $order_today_ratio = $this->growth($today_order, $yesterday_order); -// //本周订单量 -// $this_week_order = $this->dao->todayOrderVisit('week', 2); -// //上周订单量 -// $last_week_order = $this->dao->todayOrderVisit('last week', 2); -// //订单周同比 -// $order_week_ratio = $this->growth($this_week_order, $last_week_order); //总订单量 $total_order = $this->dao->count(['time' => 'month', 'paid' => 1, 'refund_status' => 0, 'pid' => 0]); $order = [ 'today' => $today_order, 'yesterday' => $yesterday_order, 'today_ratio' => $order_today_ratio, -// 'week' => $this_week_order, -// 'last_week' => $last_week_order, -// 'week_ratio' => $order_week_ratio, 'total' => $total_order . '单', 'date' => '今日' ]; //TODO 用户 //今日新增用户 - $today_user = $uSercice->todayAddVisits('today', 1); + $today_user = $userService->todayAddVisits('today', 1); //昨日新增用户 - $yesterday_user = $uSercice->todayAddVisits('yesterday', 1); + $yesterday_user = $userService->todayAddVisits('yesterday', 1); //新增用户日同比 $user_today_ratio = $this->growth($today_user, $yesterday_user); -// //本周新增用户 -// $this_week_user = $uSercice->todayAddVisits('week', 2); -// //上周新增用户 -// $last_week_user = $uSercice->todayAddVisits('last week', 2); -// //新增用户周同比 -// $user_week_ratio = $this->growth($this_week_user, $last_week_user); //所有用户 - $total_user = $uSercice->count(['time' => 'month']); + $total_user = $userService->count(['time' => 'month']); $user = [ 'today' => $today_user, 'yesterday' => $yesterday_user, 'today_ratio' => $user_today_ratio, -// 'week' => $this_week_user, -// 'last_week' => $last_week_user, -// 'week_ratio' => $user_week_ratio, 'total' => $total_user . '人', 'date' => '今日' ]; @@ -2566,12 +2536,12 @@ HTML; public function autoComment() { //自动评价天数 - $systemCommentTime = (int)sys_config('system_comment_time', 0); + $systemCommentTime = sys_config('system_comment_time', 0); //0为取消自动默认好评功能 if ($systemCommentTime == 0) { return true; } - $sevenDay = strtotime(date('Y-m-d H:i:s', strtotime('-' . $systemCommentTime . ' day'))); + $sevenDay = bcsub((string)time(), bcmul((string)$systemCommentTime, '86400')); /** @var StoreOrderStoreOrderStatusServices $service */ $service = app()->make(StoreOrderStoreOrderStatusServices::class); $orderList = $service->getTakeOrderIds([ @@ -2579,7 +2549,7 @@ HTML; 'is_del' => 0, 'paid' => 1, 'status' => 2, - 'change_type' => ['take_delivery'] + 'change_type' => ['take_delivery','user_take_delivery'] ], 30); foreach ($orderList as $item) { AutoCommentJob::dispatch([$item['id'], $item['cart_id']]); diff --git a/crmeb/app/services/order/StoreOrderTakeServices.php b/crmeb/app/services/order/StoreOrderTakeServices.php index 7e98b8060..e16fc003a 100644 --- a/crmeb/app/services/order/StoreOrderTakeServices.php +++ b/crmeb/app/services/order/StoreOrderTakeServices.php @@ -522,12 +522,12 @@ class StoreOrderTakeServices extends BaseServices public function autoTakeOrder() { //7天前时间戳 - $systemDeliveryTime = (int)sys_config('system_delivery_time', 0); + $systemDeliveryTime = sys_config('system_delivery_time', 0); //0为取消自动收货功能 if ($systemDeliveryTime == 0) { return true; } - $sevenDay = strtotime(date('Y-m-d H:i:s', strtotime('-' . $systemDeliveryTime . ' day'))); + $sevenDay = bcsub((string)time(), bcmul((string)$systemDeliveryTime, '86400')); /** @var StoreOrderStoreOrderStatusServices $service */ $service = app()->make(StoreOrderStoreOrderStatusServices::class); $orderList = $service->getTakeOrderIds([ diff --git a/crmeb/app/services/product/product/StoreProductReplyServices.php b/crmeb/app/services/product/product/StoreProductReplyServices.php index 73fc4725d..a29266557 100644 --- a/crmeb/app/services/product/product/StoreProductReplyServices.php +++ b/crmeb/app/services/product/product/StoreProductReplyServices.php @@ -63,7 +63,7 @@ class StoreProductReplyServices extends BaseServices public function createForm(int $product_id) { if ($product_id == 0) { - $field[] = Form::frameImage('image', '商品', Url::buildUrl('admin/store.StoreProduct/index', array('fodder' => 'image')))->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true])->Props(['srcKey' => 'image']); + $field[] = Form::frameImage('image', '商品', Url::buildUrl(config('app.admin_prefix', 'admin') . '/store.StoreProduct/index', array('fodder' => 'image')))->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true])->Props(['srcKey' => 'image']); } else { $field[] = Form::hidden('product_id', $product_id); } diff --git a/crmeb/app/services/system/SystemLangServices.php b/crmeb/app/services/system/SystemLangServices.php index 3bd78d40f..02d8db087 100644 --- a/crmeb/app/services/system/SystemLangServices.php +++ b/crmeb/app/services/system/SystemLangServices.php @@ -144,7 +144,7 @@ class SystemLangServices extends BaseServices $field[] = Form::input('unique_auth', '权限标识', $formData['unique_auth'] ?? '')->placeholder('不填写则后台自动生成'); $params = $formData['params'] ?? ''; // $field[] = Form::input('params', '参数', is_array($params) ? '' : $params)->placeholder('举例:a/123/b/234'); - $field[] = Form::frameInput('icon', '图标', $this->url('admin/widget.widgets/icon', ['fodder' => 'icon']), $formData['icon'] ?? '')->icon('md-add')->height('505px')->modal(['footer-hide' => true]); + $field[] = Form::frameInput('icon', '图标', $this->url(config('app.admin_prefix', 'admin') . '/widget.widgets/icon', ['fodder' => 'icon']), $formData['icon'] ?? '')->icon('md-add')->height('505px')->modal(['footer-hide' => true]); $field[] = Form::number('sort', '排序', (int)($formData['sort'] ?? 0))->precision(0); $field[] = Form::radio('auth_type', '类型', $formData['auth_type'] ?? 1)->options([['value' => 2, 'label' => '接口'], ['value' => 1, 'label' => '菜单(包含页面按钮)']]); $field[] = Form::radio('is_show', '状态', $formData['is_show'] ?? 1)->options([['value' => 0, 'label' => '关闭'], ['value' => 1, 'label' => '开启']]); diff --git a/crmeb/app/services/system/SystemMenusServices.php b/crmeb/app/services/system/SystemMenusServices.php index e2176f4a3..c616fdaca 100644 --- a/crmeb/app/services/system/SystemMenusServices.php +++ b/crmeb/app/services/system/SystemMenusServices.php @@ -149,7 +149,7 @@ class SystemMenusServices extends BaseServices $field[] = Form::input('unique_auth', '权限标识', $formData['unique_auth'] ?? '')->placeholder('不填写则后台自动生成'); $params = $formData['params'] ?? ''; // $field[] = Form::input('params', '参数', is_array($params) ? '' : $params)->placeholder('举例:a/123/b/234'); - $field[] = Form::frameInput('icon', '图标', $this->url('admin/widget.widgets/icon', ['fodder' => 'icon']), $formData['icon'] ?? '')->icon('md-add')->height('505px')->modal(['footer-hide' => true]); + $field[] = Form::frameInput('icon', '图标', $this->url(config('app.admin_prefix', 'admin') . '/widget.widgets/icon', ['fodder' => 'icon']), $formData['icon'] ?? '')->icon('md-add')->height('505px')->modal(['footer-hide' => true]); $field[] = Form::number('sort', '排序', (int)($formData['sort'] ?? 0))->precision(0); $field[] = Form::radio('auth_type', '类型', $formData['auth_type'] ?? 1)->options([['value' => 2, 'label' => '接口'], ['value' => 1, 'label' => '菜单(包含页面按钮)']]); $field[] = Form::radio('is_show', '状态', $formData['is_show'] ?? 1)->options([['value' => 0, 'label' => '关闭'], ['value' => 1, 'label' => '开启']]); diff --git a/crmeb/app/services/system/config/SystemConfigTabServices.php b/crmeb/app/services/system/config/SystemConfigTabServices.php index b7ada900b..a5e085182 100644 --- a/crmeb/app/services/system/config/SystemConfigTabServices.php +++ b/crmeb/app/services/system/config/SystemConfigTabServices.php @@ -102,7 +102,7 @@ class SystemConfigTabServices extends BaseServices $form[] = Form::select('pid', '父级分类', isset($formData['pid']) ? (string)$formData['pid'] : '')->setOptions($this->getSelectForm())->filterable(true); $form[] = Form::input('title', '分类名称', $formData['title'] ?? ''); $form[] = Form::input('eng_title', '分类字段英文', $formData['eng_title'] ?? ''); - $form[] = Form::frameInput('icon', '图标', $this->url('admin/widget.widgets/icon', ['fodder' => 'icon'], true), $formData['icon'] ?? '')->icon('ios-ionic')->height('505px')->modal(['footer-hide' => true]); + $form[] = Form::frameInput('icon', '图标', $this->url(config('app.admin_prefix', 'admin') . '/widget.widgets/icon', ['fodder' => 'icon'], true), $formData['icon'] ?? '')->icon('ios-ionic')->height('505px')->modal(['footer-hide' => true]); $form[] = Form::radio('type', '类型', $formData['type'] ?? 0)->options([ ['value' => 0, 'label' => '系统'], ['value' => 3, 'label' => '其它'] diff --git a/crmeb/app/services/system/store/SystemStoreStaffServices.php b/crmeb/app/services/system/store/SystemStoreStaffServices.php index 12df25b4c..576c47584 100644 --- a/crmeb/app/services/system/store/SystemStoreStaffServices.php +++ b/crmeb/app/services/system/store/SystemStoreStaffServices.php @@ -103,7 +103,7 @@ class SystemStoreStaffServices extends BaseServices if ($formData) { $field[] = $this->builder->frameImage('image', '更换头像', $this->url(config('app.admin_prefix', 'admin') . '/widget.images/index', array('fodder' => 'image'),true), $formData['avatar'] ?? '')->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true]); } else { - $field[] = $this->builder->frameImage('image', '商城用户', $this->url('admin/system.User/list', ['fodder' => 'image'], true))->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true])->Props(['srcKey' => 'image']); + $field[] = $this->builder->frameImage('image', '商城用户', $this->url(config('app.admin_prefix', 'admin') . '/system.User/list', ['fodder' => 'image'], true))->icon('ios-add')->width('950px')->height('505px')->modal(['footer-hide' => true])->Props(['srcKey' => 'image']); } $field[] = $this->builder->hidden('uid', $formData['uid'] ?? 0); $field[] = $this->builder->hidden('avatar', $formData['avatar'] ?? ''); diff --git a/crmeb/app/services/user/UserServices.php b/crmeb/app/services/user/UserServices.php index 408b5e9f9..dd15649fd 100644 --- a/crmeb/app/services/user/UserServices.php +++ b/crmeb/app/services/user/UserServices.php @@ -237,6 +237,7 @@ class UserServices extends BaseServices * 获取分销员ids * @param array $where * @return array + * @throws \ReflectionException */ public function getAgentUserIds(array $where) { diff --git a/crmeb/public/install/.env b/crmeb/public/install/.env index 0caf75351..71c73fb47 100755 --- a/crmeb/public/install/.env +++ b/crmeb/public/install/.env @@ -1 +1 @@ -APP_DEBUG = true [APP] DEFAULT_TIMEZONE = Asia/Shanghai [DATABASE] TYPE = mysql HOSTNAME = #DB_HOST# HOSTPORT = #DB_PORT# USERNAME = #DB_USER# PASSWORD = '#DB_PWD#' DATABASE = #DB_NAME# PREFIX = #DB_PREFIX# CHARSET = utf8 DEBUG = true [LANG] default_lang = zh-cn [CACHE] DRIVER = #CACHE_TYPE# CACHE_PREFIX = #CACHE_PREFIX# CACHE_TAG_PREFIX = #CACHE_TAG_PREFIX# [REDIS] REDIS_HOSTNAME = #RB_HOST# PORT = #RB_PORT# REDIS_PASSWORD = '#RB_PWD#' SELECT = #RB_SELECT# [QUEUE] QUEUE_NAME = #QUEUE_NAME# \ No newline at end of file +APP_DEBUG = true [APP] DEFAULT_TIMEZONE = Asia/Shanghai [DATABASE] TYPE = mysql HOSTNAME = #DB_HOST# HOSTPORT = #DB_PORT# USERNAME = #DB_USER# PASSWORD = '#DB_PWD#' DATABASE = #DB_NAME# PREFIX = #DB_PREFIX# CHARSET = utf8mb4 DEBUG = true [LANG] default_lang = zh-cn [CACHE] DRIVER = #CACHE_TYPE# CACHE_PREFIX = #CACHE_PREFIX# CACHE_TAG_PREFIX = #CACHE_TAG_PREFIX# [REDIS] REDIS_HOSTNAME = #RB_HOST# PORT = #RB_PORT# REDIS_PASSWORD = '#RB_PWD#' SELECT = #RB_SELECT# [QUEUE] QUEUE_NAME = #QUEUE_NAME# \ No newline at end of file diff --git a/crmeb/public/install/crmeb.sql b/crmeb/public/install/crmeb.sql index c111a4aa5..885862001 100755 --- a/crmeb/public/install/crmeb.sql +++ b/crmeb/public/install/crmeb.sql @@ -33347,7 +33347,7 @@ INSERT INTO `eb_system_config` (`id`, `menu_name`, `type`, `input_type`, `config (19, 'wechat_qrcode', 'upload', 'input', 2, '', 1, '', 0, 0, '\"\"', '公众号关注二维码', '引导关注公众号显示的公众号关注二维码', 76, 1), (21, 'wechat_share_title', 'text', 'input', 70, '', 0, 'required:true', 100, 0, '\"CRMEB v4\\u6807\\u51c6\\u7248\"', '微信分享标题', '微信分享标题', 0, 1), (22, 'wechat_share_synopsis', 'textarea', '', 70, '', 0, '', 100, 5, '\"\\u5b8c\\u5584\\u7684\\u6587\\u6863 \\u5168\\u201c\\u5fc3\\u201d\\u800c\\u6765\\uff01\"', '微信分享简介', '微信分享简介', 0, 1), -(25, 'pay_weixin_mchid', 'text', 'input', 4, '', 0, '', 100, 0, '\"\"', 'Mchid', '受理商ID,身份标识', 0, 1), +(25, 'pay_weixin_mchid', 'text', 'input', 4, '', 0, '', 100, 0, '\"\"', 'Mchid', '微信商户商户号,微信商户商户号', 0, 1), (26, 'pay_weixin_client_cert', 'upload', 'input', 4, '', 3, '', 0, 0, '\"\"', '微信支付证书', '微信支付证书,在微信商家平台中可以下载!文件名一般为apiclient_cert.pem', 0, 1), (27, 'pay_weixin_client_key', 'upload', 'input', 4, '', 3, '', 0, 0, '\"\"', '微信支付证书密钥', '微信支付证书密钥,在微信商家平台中可以下载!文件名一般为apiclient_key.pem', 0, 1), (28, 'pay_weixin_key', 'text', 'input', 4, '', 0, '', 100, 0, '\"\"', 'Key', '商户支付密钥Key。审核通过后,在微信发送的邮件中查看。', 0, 1), diff --git a/template/admin/src/api/product.js b/template/admin/src/api/product.js index bdfac1496..9cc416666 100644 --- a/template/admin/src/api/product.js +++ b/template/admin/src/api/product.js @@ -106,6 +106,16 @@ export function treeListApi(type) { }); } +/** + * @description 商品管理-- 分类 new + */ +export function cascaderListApi(type) { + return request({ + url: `product/category/cascader/${type}`, + method: 'get', + }); +} + /** * @description 商品管理-- 详情 */ diff --git a/template/admin/src/assets/images/sort03.png b/template/admin/src/assets/images/sort03.png new file mode 100644 index 000000000..eeec4b80c Binary files /dev/null and b/template/admin/src/assets/images/sort03.png differ diff --git a/template/admin/src/components/goodsList/index.vue b/template/admin/src/components/goodsList/index.vue index c3b8119ac..994d4a0fb 100644 --- a/template/admin/src/components/goodsList/index.vue +++ b/template/admin/src/components/goodsList/index.vue @@ -4,11 +4,18 @@ -