diff --git a/app/admin/controller/store_extract/StoreExtractController.php b/app/admin/controller/store_extract/StoreExtractController.php new file mode 100644 index 000000000..855d4f55e --- /dev/null +++ b/app/admin/controller/store_extract/StoreExtractController.php @@ -0,0 +1,95 @@ +dataLists(new StoreExtractLists()); + } + + + /** + * @notes 添加门店提现 + * @return \think\response\Json + * @author admin + * @date 2024/05/31 17:09 + */ + public function add() + { + $params = (new StoreExtractValidate())->post()->goCheck('add'); + $result = StoreExtractLogic::add($params); + if (true === $result) { + return $this->success('添加成功', [], 1, 1); + } + return $this->fail(StoreExtractLogic::getError()); + } + + + /** + * @notes 编辑门店提现 + * @return \think\response\Json + * @author admin + * @date 2024/05/31 17:09 + */ + public function edit() + { + $params = (new StoreExtractValidate())->post()->goCheck('edit'); + $result = StoreExtractLogic::edit($params); + if (true === $result) { + return $this->success('编辑成功', [], 1, 1); + } + return $this->fail(StoreExtractLogic::getError()); + } + + + /** + * @notes 删除门店提现 + * @return \think\response\Json + * @author admin + * @date 2024/05/31 17:09 + */ + public function delete() + { + $params = (new StoreExtractValidate())->post()->goCheck('delete'); + StoreExtractLogic::delete($params); + return $this->success('删除成功', [], 1, 1); + } + + + /** + * @notes 获取门店提现详情 + * @return \think\response\Json + * @author admin + * @date 2024/05/31 17:09 + */ + public function detail() + { + $params = (new StoreExtractValidate())->goCheck('detail'); + $result = StoreExtractLogic::detail($params); + return $this->data($result); + } + + +} \ No newline at end of file diff --git a/app/admin/controller/store_finance_flow/StoreFinanceFlowController.php b/app/admin/controller/store_finance_flow/StoreFinanceFlowController.php new file mode 100644 index 000000000..f005e2e03 --- /dev/null +++ b/app/admin/controller/store_finance_flow/StoreFinanceFlowController.php @@ -0,0 +1,95 @@ +dataLists(new StoreFinanceFlowLists()); + } + + + /** + * @notes 添加门店流水 + * @return \think\response\Json + * @author admin + * @date 2024/05/31 16:56 + */ + public function add() + { + $params = (new StoreFinanceFlowValidate())->post()->goCheck('add'); + $result = StoreFinanceFlowLogic::add($params); + if (true === $result) { + return $this->success('添加成功', [], 1, 1); + } + return $this->fail(StoreFinanceFlowLogic::getError()); + } + + + /** + * @notes 编辑门店流水 + * @return \think\response\Json + * @author admin + * @date 2024/05/31 16:56 + */ + public function edit() + { + $params = (new StoreFinanceFlowValidate())->post()->goCheck('edit'); + $result = StoreFinanceFlowLogic::edit($params); + if (true === $result) { + return $this->success('编辑成功', [], 1, 1); + } + return $this->fail(StoreFinanceFlowLogic::getError()); + } + + + /** + * @notes 删除门店流水 + * @return \think\response\Json + * @author admin + * @date 2024/05/31 16:56 + */ + public function delete() + { + $params = (new StoreFinanceFlowValidate())->post()->goCheck('delete'); + StoreFinanceFlowLogic::delete($params); + return $this->success('删除成功', [], 1, 1); + } + + + /** + * @notes 获取门店流水详情 + * @return \think\response\Json + * @author admin + * @date 2024/05/31 16:56 + */ + public function detail() + { + $params = (new StoreFinanceFlowValidate())->goCheck('detail'); + $result = StoreFinanceFlowLogic::detail($params); + return $this->data($result); + } + + +} \ No newline at end of file diff --git a/app/admin/controller/system_store/SystemStoreController.php b/app/admin/controller/system_store/SystemStoreController.php new file mode 100644 index 000000000..bb4badff3 --- /dev/null +++ b/app/admin/controller/system_store/SystemStoreController.php @@ -0,0 +1,106 @@ +dataLists(new SystemStoreLists()); + } + /** + * @notes 根据商品源获取门店列表 + * @return \think\response\Json + * @author admin + * @date 2024/05/31 17:45 + */ + public function source_product_store_lists() + { + return $this->dataLists(new SystemStoreSourceLists()); + } + + + /** + * @notes 添加门店列表 + * @return \think\response\Json + * @author admin + * @date 2024/05/31 17:45 + */ + public function add() + { + $params = (new SystemStoreValidate())->post()->goCheck('add'); + $result = SystemStoreLogic::add($params); + if (true === $result) { + return $this->success('添加成功', [], 1, 1); + } + return $this->fail(SystemStoreLogic::getError()); + } + + + /** + * @notes 编辑门店列表 + * @return \think\response\Json + * @author admin + * @date 2024/05/31 17:45 + */ + public function edit() + { + $params = (new SystemStoreValidate())->post()->goCheck('edit'); + $result = SystemStoreLogic::edit($params); + if (true === $result) { + return $this->success('编辑成功', [], 1, 1); + } + return $this->fail(SystemStoreLogic::getError()); + } + + + /** + * @notes 删除门店列表 + * @return \think\response\Json + * @author admin + * @date 2024/05/31 17:45 + */ + public function delete() + { + $params = (new SystemStoreValidate())->post()->goCheck('delete'); + SystemStoreLogic::delete($params); + return $this->success('删除成功', [], 1, 1); + } + + + /** + * @notes 获取门店列表详情 + * @return \think\response\Json + * @author admin + * @date 2024/05/31 17:45 + */ + public function detail() + { + $params = (new SystemStoreValidate())->goCheck('detail'); + $result = SystemStoreLogic::detail($params); + return $this->data($result); + } + + +} \ No newline at end of file diff --git a/app/admin/controller/user_bill/UserBillController.php b/app/admin/controller/user_bill/UserBillController.php new file mode 100644 index 000000000..c4cdb6dfc --- /dev/null +++ b/app/admin/controller/user_bill/UserBillController.php @@ -0,0 +1,95 @@ +dataLists(new UserBillLists()); + } + + + /** + * @notes 添加资金记录 + * @return \think\response\Json + * @author admin + * @date 2024/05/31 16:44 + */ + public function add() + { + $params = (new UserBillValidate())->post()->goCheck('add'); + $result = UserBillLogic::add($params); + if (true === $result) { + return $this->success('添加成功', [], 1, 1); + } + return $this->fail(UserBillLogic::getError()); + } + + + /** + * @notes 编辑资金记录 + * @return \think\response\Json + * @author admin + * @date 2024/05/31 16:44 + */ + public function edit() + { + $params = (new UserBillValidate())->post()->goCheck('edit'); + $result = UserBillLogic::edit($params); + if (true === $result) { + return $this->success('编辑成功', [], 1, 1); + } + return $this->fail(UserBillLogic::getError()); + } + + + /** + * @notes 删除资金记录 + * @return \think\response\Json + * @author admin + * @date 2024/05/31 16:44 + */ + public function delete() + { + $params = (new UserBillValidate())->post()->goCheck('delete'); + UserBillLogic::delete($params); + return $this->success('删除成功', [], 1, 1); + } + + + /** + * @notes 获取资金记录详情 + * @return \think\response\Json + * @author admin + * @date 2024/05/31 16:44 + */ + public function detail() + { + $params = (new UserBillValidate())->goCheck('detail'); + $result = UserBillLogic::detail($params); + return $this->data($result); + } + + +} \ No newline at end of file diff --git a/app/admin/lists/store_category/StoreCategoryLists.php b/app/admin/lists/store_category/StoreCategoryLists.php index 614a72197..c42126c46 100644 --- a/app/admin/lists/store_category/StoreCategoryLists.php +++ b/app/admin/lists/store_category/StoreCategoryLists.php @@ -26,7 +26,8 @@ class StoreCategoryLists extends BaseAdminDataLists implements ListsSearchInterf public function setSearch(): array { return [ - '=' => ['name','pid'], + '=' => ['pid'], + '%like%' => ['name'], ]; } @@ -46,7 +47,10 @@ class StoreCategoryLists extends BaseAdminDataLists implements ListsSearchInterf ->field(['id', 'pid', 'name', 'data', 'pic', 'sort']) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) - ->select() + ->select()->each(function ($item) { + $item['is_children'] = StoreCategory::where('pid', $item->id)->count(); // 判断是否有子分类 + return $item->toArray(); + }) ->toArray(); } diff --git a/app/admin/lists/store_extract/StoreExtractLists.php b/app/admin/lists/store_extract/StoreExtractLists.php new file mode 100644 index 000000000..af2f4ac44 --- /dev/null +++ b/app/admin/lists/store_extract/StoreExtractLists.php @@ -0,0 +1,65 @@ + ['store_id', 'extract_type', 'status', 'pay_status', 'create_time'], + ]; + } + + + /** + * @notes 获取门店提现列表 + * @return array + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + * @author admin + * @date 2024/05/31 17:09 + */ + public function lists(): array + { + return StoreExtract::where($this->searchWhere) + ->field(['id', 'store_id', 'extract_type', 'extract_price', 'mark', 'status', 'pay_status', 'admin_id', 'create_time']) + ->limit($this->limitOffset, $this->limitLength) + ->order(['id' => 'desc']) + ->select() + ->toArray(); + } + + + /** + * @notes 获取门店提现数量 + * @return int + * @author admin + * @date 2024/05/31 17:09 + */ + public function count(): int + { + return StoreExtract::where($this->searchWhere)->count(); + } + +} \ No newline at end of file diff --git a/app/admin/lists/store_finance_flow/StoreFinanceFlowLists.php b/app/admin/lists/store_finance_flow/StoreFinanceFlowLists.php new file mode 100644 index 000000000..00c75b096 --- /dev/null +++ b/app/admin/lists/store_finance_flow/StoreFinanceFlowLists.php @@ -0,0 +1,65 @@ + ['store_id', 'uid', 'create_time'], + ]; + } + + + /** + * @notes 获取门店流水列表 + * @return array + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + * @author admin + * @date 2024/05/31 16:56 + */ + public function lists(): array + { + return StoreFinanceFlow::where($this->searchWhere) + ->field(['id', 'uid', 'staff_id', 'order_id', 'link_id', 'type', 'pay_type', 'remark', 'trade_time']) + ->limit($this->limitOffset, $this->limitLength) + ->order(['id' => 'desc']) + ->select() + ->toArray(); + } + + + /** + * @notes 获取门店流水数量 + * @return int + * @author admin + * @date 2024/05/31 16:56 + */ + public function count(): int + { + return StoreFinanceFlow::where($this->searchWhere)->count(); + } + +} \ No newline at end of file diff --git a/app/admin/lists/store_product/StoreProductLists.php b/app/admin/lists/store_product/StoreProductLists.php index bab5ce954..d0d12d7e6 100644 --- a/app/admin/lists/store_product/StoreProductLists.php +++ b/app/admin/lists/store_product/StoreProductLists.php @@ -8,6 +8,7 @@ use app\common\model\store_product\StoreProduct; use app\common\lists\ListsSearchInterface; use app\common\model\store_category\StoreCategory; use app\common\model\store_product_unit\StoreProductUnit; +use app\common\model\system_store\SystemStore; /** * 商品列表列表 @@ -44,7 +45,7 @@ class StoreProductLists extends BaseAdminDataLists implements ListsSearchInterfa public function lists(): array { return StoreProduct::where($this->searchWhere) - ->field(['id', 'image', 'store_name', 'cate_id', 'price', 'sales', 'stock', 'is_show', 'unit', 'cost','rose','purchase']) + ->field(['id', 'image', 'store_name', 'cate_id', 'price', 'sales', 'stock', 'is_show', 'unit', 'cost','rose','purchase','store_id','bar_code']) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) ->select()->each(function ($item) { diff --git a/app/admin/lists/system_store/SystemStoreLists.php b/app/admin/lists/system_store/SystemStoreLists.php new file mode 100644 index 000000000..e10aaa4fc --- /dev/null +++ b/app/admin/lists/system_store/SystemStoreLists.php @@ -0,0 +1,65 @@ + ['name', 'phone'], + ]; + } + + + /** + * @notes 获取门店列表列表 + * @return array + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + * @author admin + * @date 2024/05/31 17:45 + */ + public function lists(): array + { + return SystemStore::where($this->searchWhere) + ->field(['id', 'name', 'phone', 'detailed_address', 'image', 'is_show']) + ->limit($this->limitOffset, $this->limitLength) + ->order(['id' => 'desc']) + ->select() + ->toArray(); + } + + + /** + * @notes 获取门店列表数量 + * @return int + * @author admin + * @date 2024/05/31 17:45 + */ + public function count(): int + { + return SystemStore::where($this->searchWhere)->count(); + } + +} \ No newline at end of file diff --git a/app/admin/lists/system_store/SystemStoreSourceLists.php b/app/admin/lists/system_store/SystemStoreSourceLists.php new file mode 100644 index 000000000..169264c14 --- /dev/null +++ b/app/admin/lists/system_store/SystemStoreSourceLists.php @@ -0,0 +1,76 @@ + ['name', 'phone'], + ]; + } + + + /** + * @notes 获取门店列表 + * @return array + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + * @author admin + * @date 2024/05/31 17:45 + */ + public function lists(): array + { + $store_arr=StoreProduct::where('source_id',$this->request->get('product_id'))->column('store_id'); + if($store_arr){ + $this->searchWhere[]=['id', 'in', $store_arr]; + }else{ + return []; + } + return SystemStore::where($this->searchWhere) + ->field(['id', 'name', 'phone', 'detailed_address', 'image']) + ->limit($this->limitOffset, $this->limitLength) + ->order(['id' => 'desc']) + ->select() + ->toArray(); + } + + + /** + * @notes 获取门店数量 + * @return int + * @author admin + * @date 2024/05/31 17:45 + */ + public function count(): int + { + if($this->searchWhere){ + return SystemStore::where($this->searchWhere)->count(); + }else{ + return 0; + } + } + +} \ No newline at end of file diff --git a/app/admin/lists/user_bill/UserBillLists.php b/app/admin/lists/user_bill/UserBillLists.php new file mode 100644 index 000000000..d7b22a3be --- /dev/null +++ b/app/admin/lists/user_bill/UserBillLists.php @@ -0,0 +1,65 @@ + ['uid', 'type', 'create_time'], + ]; + } + + + /** + * @notes 获取资金记录列表 + * @return array + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + * @author admin + * @date 2024/05/31 16:44 + */ + public function lists(): array + { + return UserBill::where($this->searchWhere) + ->field(['id', 'type', 'number', 'mark', 'create_time']) + ->limit($this->limitOffset, $this->limitLength) + ->order(['id' => 'desc']) + ->select() + ->toArray(); + } + + + /** + * @notes 获取资金记录数量 + * @return int + * @author admin + * @date 2024/05/31 16:44 + */ + public function count(): int + { + return UserBill::where($this->searchWhere)->count(); + } + +} \ No newline at end of file diff --git a/app/admin/logic/store_extract/StoreExtractLogic.php b/app/admin/logic/store_extract/StoreExtractLogic.php new file mode 100644 index 000000000..f11d97ccd --- /dev/null +++ b/app/admin/logic/store_extract/StoreExtractLogic.php @@ -0,0 +1,94 @@ +getMessage()); + return false; + } + } + + + /** + * @notes 编辑门店提现 + * @param array $params + * @return bool + * @author admin + * @date 2024/05/31 17:09 + */ + public static function edit(array $params): bool + { + Db::startTrans(); + try { + StoreExtract::where('id', $params['id'])->update([ + + ]); + + Db::commit(); + return true; + } catch (\Exception $e) { + Db::rollback(); + self::setError($e->getMessage()); + return false; + } + } + + + /** + * @notes 删除门店提现 + * @param array $params + * @return bool + * @author admin + * @date 2024/05/31 17:09 + */ + public static function delete(array $params): bool + { + return StoreExtract::destroy($params['id']); + } + + + /** + * @notes 获取门店提现详情 + * @param $params + * @return array + * @author admin + * @date 2024/05/31 17:09 + */ + public static function detail($params): array + { + return StoreExtract::findOrEmpty($params['id'])->toArray(); + } +} \ No newline at end of file diff --git a/app/admin/logic/store_finance_flow/StoreFinanceFlowLogic.php b/app/admin/logic/store_finance_flow/StoreFinanceFlowLogic.php new file mode 100644 index 000000000..d4dec2553 --- /dev/null +++ b/app/admin/logic/store_finance_flow/StoreFinanceFlowLogic.php @@ -0,0 +1,94 @@ +getMessage()); + return false; + } + } + + + /** + * @notes 编辑门店流水 + * @param array $params + * @return bool + * @author admin + * @date 2024/05/31 16:56 + */ + public static function edit(array $params): bool + { + Db::startTrans(); + try { + StoreFinanceFlow::where('id', $params['id'])->update([ + + ]); + + Db::commit(); + return true; + } catch (\Exception $e) { + Db::rollback(); + self::setError($e->getMessage()); + return false; + } + } + + + /** + * @notes 删除门店流水 + * @param array $params + * @return bool + * @author admin + * @date 2024/05/31 16:56 + */ + public static function delete(array $params): bool + { + return StoreFinanceFlow::destroy($params['id']); + } + + + /** + * @notes 获取门店流水详情 + * @param $params + * @return array + * @author admin + * @date 2024/05/31 16:56 + */ + public static function detail($params): array + { + return StoreFinanceFlow::findOrEmpty($params['id'])->toArray(); + } +} \ No newline at end of file diff --git a/app/admin/logic/store_product/StoreProductLogic.php b/app/admin/logic/store_product/StoreProductLogic.php index 927b33641..6747db80d 100644 --- a/app/admin/logic/store_product/StoreProductLogic.php +++ b/app/admin/logic/store_product/StoreProductLogic.php @@ -5,10 +5,13 @@ namespace app\admin\logic\store_product; use app\common\model\store_product\StoreProduct; use app\common\logic\BaseLogic; +use app\common\model\store_branch_product\StoreBranchProduct; +use app\common\model\store_branch_product_attr_value\StoreBranchProductAttrValue; use app\common\model\store_category\StoreCategory; use app\common\model\store_product_attr_value\StoreProductAttrValue; +use app\common\model\system_store\SystemStore; use think\facade\Db; - +use Webman\RedisQueue\Redis; /** * 商品列表逻辑 @@ -59,6 +62,17 @@ class StoreProductLogic extends BaseLogic StoreCategory::where('id', $params['cate_id'])->inc('three')->update(); Db::commit(); + + if ($params['is_store_all'] == 1) { + $store_arr = SystemStore::where('is_show', 1)->column('id'); + Redis::send('copy-product', ['product_id' => $res['id'], 'store_arr' => $store_arr]); + } else { + if (is_array($params['store_arr']) && count($params['store_arr']) > 0) { + Redis::send('copy-product', ['product_id' => $res['id'], 'store_arr' => $params['store_arr']]); + } + } + + return true; } catch (\Exception $e) { Db::rollback(); @@ -85,7 +99,15 @@ class StoreProductLogic extends BaseLogic StoreCategory::where('id', $StoreProduct['cate_id'])->dec('three')->update(); } StoreProduct::where('id', $params['id'])->update([ - 'store_name' => $params['store_name'] + 'store_name' => $params['store_name'], + 'image' => $params['image'], + 'bar_code' => $params['bar_code'] ?? '', + 'cate_id' => $params['cate_id'], + 'unit' => $params['unit'], + 'stock' => $params['stock'], + 'cost' => $params['cost'], + 'purchase' => $params['purchase'], + 'rose' => $params['rose'], ]); Db::commit(); @@ -120,7 +142,7 @@ class StoreProductLogic extends BaseLogic */ public static function detail($params): array { - return StoreProduct::findOrEmpty($params['id'])->toArray(); + return StoreProduct::where('id',$params['id'])->findOrEmpty()->toArray(); } /** @@ -145,4 +167,48 @@ class StoreProductLogic extends BaseLogic } } } + + /** + * 复制商品到门店 + */ + public static function copy($id, $store_id) + { + $find = StoreProduct::where('id', $id)->findOrEmpty()->toArray(); + $store_find = StoreBranchProduct::where(['product_id' => $id, 'store_id' => $store_id])->findOrEmpty()->toArray(); + if ($find && !$store_find) { + $attr_value = StoreProductAttrValue::where('product_id', $id)->findOrEmpty(); + Db::startTrans(); + try { + $product = [ + 'product_id' => $find['id'], + 'image' => $find['image'], + 'store_name' => $find['store_name'], + 'store_info' => $find['store_info'], + 'keyword' => $find['keyword'], + 'bar_code' => $find['bar_code'], + 'cate_id' => $find['cate_id'], + 'store_id' => $store_id, + 'sales' => 0, + 'stock' =>0, + ]; + StoreBranchProduct::create($product); + $arr = [ + 'product_id' => $id, + 'store_id' => $store_id, + 'sales' => 0, + 'stock' => 0, + 'type' => 0, + 'bar_code' => $attr_value['bar_code'] + ]; + StoreBranchProductAttrValue::create($arr); + Db::commit(); + return true; + } catch (\Exception $e) { + Db::rollback(); + d($e); + self::setError($e->getMessage()); + return false; + } + } + } } diff --git a/app/admin/logic/store_product_unit/StoreProductUnitLogic.php b/app/admin/logic/store_product_unit/StoreProductUnitLogic.php index 9ec2c073d..9ea649ec1 100644 --- a/app/admin/logic/store_product_unit/StoreProductUnitLogic.php +++ b/app/admin/logic/store_product_unit/StoreProductUnitLogic.php @@ -34,7 +34,6 @@ class StoreProductUnitLogic extends BaseLogic 'py' => $params['py'], 'number' => $params['number'], 'data' => $params['data'], - 'more' => $params['more'] ]); Db::commit(); @@ -64,7 +63,6 @@ class StoreProductUnitLogic extends BaseLogic 'py' => $params['py'], 'number' => $params['number'], 'data' => $params['data'], - 'more' => $params['more'] ]); Db::commit(); diff --git a/app/admin/logic/system_store/SystemStoreLogic.php b/app/admin/logic/system_store/SystemStoreLogic.php new file mode 100644 index 000000000..42a601854 --- /dev/null +++ b/app/admin/logic/system_store/SystemStoreLogic.php @@ -0,0 +1,106 @@ + $params['name'], + 'introduction' => $params['introduction'], + 'phone' => $params['phone'], + 'detailed_address' => $params['detailed_address'], + 'image' => $params['image'], + 'is_show' => $params['is_show'] + ]); + + Db::commit(); + return true; + } catch (\Exception $e) { + Db::rollback(); + self::setError($e->getMessage()); + return false; + } + } + + + /** + * @notes 编辑门店列表 + * @param array $params + * @return bool + * @author admin + * @date 2024/05/31 17:45 + */ + public static function edit(array $params): bool + { + Db::startTrans(); + try { + SystemStore::where('id', $params['id'])->update([ + 'name' => $params['name'], + 'introduction' => $params['introduction'], + 'phone' => $params['phone'], + 'detailed_address' => $params['detailed_address'], + 'image' => $params['image'], + 'latitude' => $params['latitude'], + 'longitude' => $params['longitude'], + 'is_show' => $params['is_show'] + ]); + + Db::commit(); + return true; + } catch (\Exception $e) { + Db::rollback(); + self::setError($e->getMessage()); + return false; + } + } + + + /** + * @notes 删除门店列表 + * @param array $params + * @return bool + * @author admin + * @date 2024/05/31 17:45 + */ + public static function delete(array $params): bool + { + return SystemStore::destroy($params['id']); + } + + + /** + * @notes 获取门店列表详情 + * @param $params + * @return array + * @author admin + * @date 2024/05/31 17:45 + */ + public static function detail($params): array + { + return SystemStore::findOrEmpty($params['id'])->toArray(); + } +} \ No newline at end of file diff --git a/app/admin/logic/user_bill/UserBillLogic.php b/app/admin/logic/user_bill/UserBillLogic.php new file mode 100644 index 000000000..f586146df --- /dev/null +++ b/app/admin/logic/user_bill/UserBillLogic.php @@ -0,0 +1,94 @@ +getMessage()); + return false; + } + } + + + /** + * @notes 编辑资金记录 + * @param array $params + * @return bool + * @author admin + * @date 2024/05/31 16:44 + */ + public static function edit(array $params): bool + { + Db::startTrans(); + try { + UserBill::where('id', $params['id'])->update([ + + ]); + + Db::commit(); + return true; + } catch (\Exception $e) { + Db::rollback(); + self::setError($e->getMessage()); + return false; + } + } + + + /** + * @notes 删除资金记录 + * @param array $params + * @return bool + * @author admin + * @date 2024/05/31 16:44 + */ + public static function delete(array $params): bool + { + return UserBill::destroy($params['id']); + } + + + /** + * @notes 获取资金记录详情 + * @param $params + * @return array + * @author admin + * @date 2024/05/31 16:44 + */ + public static function detail($params): array + { + return UserBill::findOrEmpty($params['id'])->toArray(); + } +} \ No newline at end of file diff --git a/app/admin/validate/store_extract/StoreExtractValidate.php b/app/admin/validate/store_extract/StoreExtractValidate.php new file mode 100644 index 000000000..e9a9fc804 --- /dev/null +++ b/app/admin/validate/store_extract/StoreExtractValidate.php @@ -0,0 +1,82 @@ + 'require', + ]; + + + /** + * 参数描述 + * @var string[] + */ + protected $field = [ + 'id' => 'id', + ]; + + + /** + * @notes 添加场景 + * @return StoreExtractValidate + * @author admin + * @date 2024/05/31 17:09 + */ + public function sceneAdd() + { + return $this->remove('id', true); + } + + + /** + * @notes 编辑场景 + * @return StoreExtractValidate + * @author admin + * @date 2024/05/31 17:09 + */ + public function sceneEdit() + { + return $this->only(['id']); + } + + + /** + * @notes 删除场景 + * @return StoreExtractValidate + * @author admin + * @date 2024/05/31 17:09 + */ + public function sceneDelete() + { + return $this->only(['id']); + } + + + /** + * @notes 详情场景 + * @return StoreExtractValidate + * @author admin + * @date 2024/05/31 17:09 + */ + public function sceneDetail() + { + return $this->only(['id']); + } + +} \ No newline at end of file diff --git a/app/admin/validate/store_finance_flow/StoreFinanceFlowValidate.php b/app/admin/validate/store_finance_flow/StoreFinanceFlowValidate.php new file mode 100644 index 000000000..05a1abf42 --- /dev/null +++ b/app/admin/validate/store_finance_flow/StoreFinanceFlowValidate.php @@ -0,0 +1,82 @@ + 'require', + ]; + + + /** + * 参数描述 + * @var string[] + */ + protected $field = [ + 'id' => 'id', + ]; + + + /** + * @notes 添加场景 + * @return StoreFinanceFlowValidate + * @author admin + * @date 2024/05/31 16:56 + */ + public function sceneAdd() + { + return $this->remove('id', true); + } + + + /** + * @notes 编辑场景 + * @return StoreFinanceFlowValidate + * @author admin + * @date 2024/05/31 16:56 + */ + public function sceneEdit() + { + return $this->only(['id']); + } + + + /** + * @notes 删除场景 + * @return StoreFinanceFlowValidate + * @author admin + * @date 2024/05/31 16:56 + */ + public function sceneDelete() + { + return $this->only(['id']); + } + + + /** + * @notes 详情场景 + * @return StoreFinanceFlowValidate + * @author admin + * @date 2024/05/31 16:56 + */ + public function sceneDetail() + { + return $this->only(['id']); + } + +} \ No newline at end of file diff --git a/app/admin/validate/system_store/SystemStoreValidate.php b/app/admin/validate/system_store/SystemStoreValidate.php new file mode 100644 index 000000000..a3590881c --- /dev/null +++ b/app/admin/validate/system_store/SystemStoreValidate.php @@ -0,0 +1,94 @@ + 'require', + 'name' => 'require', + 'phone' => 'require', + 'detailed_address' => 'require', + 'image' => 'require', + 'latitude' => 'require', + 'longitude' => 'require', + ]; + + + /** + * 参数描述 + * @var string[] + */ + protected $field = [ + 'id' => 'id', + 'name' => '门店名称', + 'phone' => '手机号码', + 'detailed_address' => '详细地址', + 'image' => '门店logo', + 'latitude' => '纬度', + 'longitude' => '经度', + ]; + + + /** + * @notes 添加场景 + * @return SystemStoreValidate + * @author admin + * @date 2024/05/31 17:45 + */ + public function sceneAdd() + { + return $this->only(['name','phone','detailed_address','image','latitude','longitude']); + } + + + /** + * @notes 编辑场景 + * @return SystemStoreValidate + * @author admin + * @date 2024/05/31 17:45 + */ + public function sceneEdit() + { + return $this->only(['id','name','phone','detailed_address','image','latitude','longitude']); + } + + + /** + * @notes 删除场景 + * @return SystemStoreValidate + * @author admin + * @date 2024/05/31 17:45 + */ + public function sceneDelete() + { + return $this->only(['id']); + } + + + /** + * @notes 详情场景 + * @return SystemStoreValidate + * @author admin + * @date 2024/05/31 17:45 + */ + public function sceneDetail() + { + return $this->only(['id']); + } + +} \ No newline at end of file diff --git a/app/admin/validate/user_bill/UserBillValidate.php b/app/admin/validate/user_bill/UserBillValidate.php new file mode 100644 index 000000000..107ebaac1 --- /dev/null +++ b/app/admin/validate/user_bill/UserBillValidate.php @@ -0,0 +1,82 @@ + 'require', + ]; + + + /** + * 参数描述 + * @var string[] + */ + protected $field = [ + 'id' => 'id', + ]; + + + /** + * @notes 添加场景 + * @return UserBillValidate + * @author admin + * @date 2024/05/31 16:44 + */ + public function sceneAdd() + { + return $this->remove('id', true); + } + + + /** + * @notes 编辑场景 + * @return UserBillValidate + * @author admin + * @date 2024/05/31 16:44 + */ + public function sceneEdit() + { + return $this->only(['id']); + } + + + /** + * @notes 删除场景 + * @return UserBillValidate + * @author admin + * @date 2024/05/31 16:44 + */ + public function sceneDelete() + { + return $this->only(['id']); + } + + + /** + * @notes 详情场景 + * @return UserBillValidate + * @author admin + * @date 2024/05/31 16:44 + */ + public function sceneDetail() + { + return $this->only(['id']); + } + +} \ No newline at end of file diff --git a/app/api/controller/IndexController.php b/app/api/controller/IndexController.php index 7a6c8432f..8b50d624f 100644 --- a/app/api/controller/IndexController.php +++ b/app/api/controller/IndexController.php @@ -32,6 +32,7 @@ class IndexController extends BaseApiController public function index() { + d(uniqid(1 . '_', true)); return json(['msg' =>create_password(123456, '11d3')]); } @@ -56,10 +57,4 @@ class IndexController extends BaseApiController return $this->success('ok',$find); } - /** - * @notes 获取快递列表 - */ - public function express_list(){ - return $this->dataLists(new ExpressLists()); - } } diff --git a/app/api/controller/LoginController.php b/app/api/controller/LoginController.php index 0fdf52c37..129650aba 100644 --- a/app/api/controller/LoginController.php +++ b/app/api/controller/LoginController.php @@ -3,7 +3,7 @@ namespace app\api\controller; use app\api\logic\LoginLogic; -use app\api\validate\{LoginAccountValidate, RegisterValidate, WebScanLoginValidate, WechatLoginValidate}; +use app\api\validate\{LoginAccountValidate, WechatLoginValidate}; use app\common\model\user\UserAuth; class LoginController extends BaseApiController @@ -35,7 +35,7 @@ class LoginController extends BaseApiController /** * @notes 小程序-登录接口 - * @return \think\response\Json + * @return * @author 段誉 * @date 2022/9/20 19:48 */ @@ -52,7 +52,7 @@ class LoginController extends BaseApiController /** * @notes 小程序绑定微信 - * @return \think\response\Json + * @return * @author 段誉 * @date 2022/9/20 19:48 */ @@ -69,7 +69,7 @@ class LoginController extends BaseApiController /** * @notes 更新用户头像昵称 - * @return \think\response\Json + * @return * @author 段誉 * @date 2023/2/22 11:15 */ diff --git a/app/api/controller/cate/CateController.php b/app/api/controller/cate/CateController.php new file mode 100644 index 000000000..b0ae89807 --- /dev/null +++ b/app/api/controller/cate/CateController.php @@ -0,0 +1,29 @@ +dataLists(new CateLists()); + } + + +} \ No newline at end of file diff --git a/app/api/controller/store/StoreController.php b/app/api/controller/store/StoreController.php new file mode 100644 index 000000000..4d378a6cd --- /dev/null +++ b/app/api/controller/store/StoreController.php @@ -0,0 +1,17 @@ +dataLists(new SystemStoreLists()); + } + + +} \ No newline at end of file diff --git a/app/api/controller/user/AddressController.php b/app/api/controller/user/AddressController.php new file mode 100644 index 000000000..1fbe2bf59 --- /dev/null +++ b/app/api/controller/user/AddressController.php @@ -0,0 +1,97 @@ +dataLists(new UserAddressList()); + } + + /** + * 添加地址 + * @return \support\Response + */ + public function create() + { + $params = (new UserAddressValidate())->post()->goCheck('add'); + $params['uid'] = $this->request->userId; + $res=AddressLogic::add($params); + if(AddressLogic::hasError()){ + return $this->fail(AddressLogic::getError()); + }else{ + return $this->success('添加成功'); + } + } + /** + * 商户给用户添加地址 + */ + /* public function merchant_create() + { + $params = $this->request->post(); + if($params['order_id'] && $params['order_id']!=0){ + $uid=Cashierclass::where('id',$params['order_id'])->value('uid'); + if(!$uid || $uid<=0){ + return $this->fail('订单不存在'); + } + } + $params['uid'] = $uid; + $res=AddressLogic::add($params); + if(AddressLogic::hasError()){ + return $this->fail(AddressLogic::getError()); + }else{ + Cashierclass::where('id',$params['order_id'])->update(['address_id'=>$res,'real_name'=>$params['real_name'],'user_phone'=>$params['phone'],'user_address'=>$params['detail']]); + return $this->success('添加成功'); + } + }*/ + /** + * @notes 编辑地址 + * @return \support\Response + * @author likeadmin + * @date 2024/4/24 10:37 + */ + public function edit() + { + $params = (new UserAddressValidate())->post()->goCheck('edit'); + $params['uid'] = $this->request->userId; + if(AddressLogic::edit($params)){ + return $this->success('编辑成功'); + }else{ + return $this->fail(AddressLogic::getError()); + } + } + + + /** + * @notes 删除地址 + * @return \support\Response + * @author likeadmin + * @date 2024/4/24 10:37 + */ + public function delete() + { + $params = (new UserAddressValidate())->post()->goCheck('delete'); + if(AddressLogic::delete($params)){ + return $this->success('删除成功'); + }else{ + return $this->fail(AddressLogic::getError()); + } + } + + /** + * @notes 获取地址详情 + * @return \support\Response + * @author likeadmin + * @date 2024/4/24 10:37 + */ + public function detail() + { + $params = (new UserAddressValidate())->goCheck('detail'); + return $this->success('获取成功',AddressLogic::detail($params)); + } +} diff --git a/app/api/controller/user/UserController.php b/app/api/controller/user/UserController.php index 6fc92c844..055c9bd6b 100644 --- a/app/api/controller/user/UserController.php +++ b/app/api/controller/user/UserController.php @@ -19,7 +19,7 @@ class UserController extends BaseApiController /** * @notes 获取小程序手机号 - * @return \think\response\Json + * @return * @author 段誉 * @date 2022/9/21 16:46 */ diff --git a/app/api/controller/user/UserFeedbackController.php b/app/api/controller/user/UserFeedbackController.php new file mode 100644 index 000000000..5a954c945 --- /dev/null +++ b/app/api/controller/user/UserFeedbackController.php @@ -0,0 +1,34 @@ +dataLists(new UserFeedbackLists()); + } + + + public function add() + { + $params = (new UserFeedbackValidate())->post()->goCheck('add'); + $result = UserFeedbackLogic::add($params,$this->request->userInfo['user_id']); + if (true === $result) { + return $this->success('添加成功', [], 1, 1); + } + return $this->fail(UserFeedbackLogic::getError()); + } + } \ No newline at end of file diff --git a/app/api/lists/cate/CateLists.php b/app/api/lists/cate/CateLists.php new file mode 100644 index 000000000..8d2b74a0d --- /dev/null +++ b/app/api/lists/cate/CateLists.php @@ -0,0 +1,103 @@ + ['pid', 'name', 'data', 'pic', 'sort'], + ]; + } + + + /** + * @notes 获取商品分类列表 + * @return array + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + * @author likeadmin + * @date 2024/04/23 10:27 + */ + public function lists(): array + { + $pid=Request()->get('pid',0); + if($pid==0){ + $lists = Cate::where($this->searchWhere) + ->where('pid', 0) + ->where('children','<>',null) + ->field(['id', 'pid', 'name', 'data', 'pic', 'sort']) + ->limit($this->limitOffset, $this->limitLength) + ->order(['sort' => 'desc','id' => 'desc']) + ->select()->toArray(); + }else{ + $three=Request()->get('three',0); + if($three==0){ + $where[]=['children','<>','']; + $this->where=$where; + } + $lists = Cate::where($this->searchWhere) + ->where($this->where) + ->field(['id', 'pid', 'name', 'data', 'pic', 'sort']) + ->limit($this->limitOffset, $this->limitLength) + ->order(['sort' => 'desc','id' => 'desc']) + ->select()->toArray(); + } + // ->each(function ($item) { + // $a = Goodsclass::where('pid', $item['id'])->field(['id', 'pid', 'name', 'data', 'pic', 'sort'])->select(); + // $item['children'] = $a; + // foreach ($a as $k => &$v) { + // $b = Goodsclass::where('pid', $v['id'])->field(['id', 'pid', 'name', 'data', 'pic', 'sort'])->select(); + // $v['children'] = $b; + // } + // })->toArray(); + + return $lists; + // return linear_to_tree($lists, 'children'); + + } + + + /** + * @notes 获取商品分类数量 + * @return int + * @author likeadmin + * @date 2024/04/23 10:27 + */ + public function count(): int + { + $pid=Request()->get('pid',0); + if($pid==0){ + return Cate::where($this->searchWhere)->where('pid', 0) + ->where('children','<>',null) + ->count(); + }else{ + return Cate::where($this->searchWhere) + ->where($this->where) + ->count(); + } + + } + +} \ No newline at end of file diff --git a/app/api/lists/store/SystemStoreLists.php b/app/api/lists/store/SystemStoreLists.php new file mode 100644 index 000000000..672c7f404 --- /dev/null +++ b/app/api/lists/store/SystemStoreLists.php @@ -0,0 +1,71 @@ + ['phone'], + '%like%' => ['name'], + ]; + } + + + /** + * @notes 获取门店列表列表 + * @return array + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + * @author admin + * @date 2024/05/31 17:45 + */ + public function lists(): array + { + $where[]=['is_show','=',YesNoEnum::YES]; + return SystemStore::where($this->searchWhere)->where($where) + ->field(['id', 'name', 'phone', 'detailed_address', 'image', 'is_show', + 'day_time','is_store','latitude','longitude' + ]) + ->limit($this->limitOffset, $this->limitLength) + ->order(['id' => 'desc']) + ->select() + ->toArray(); + } + + + /** + * @notes 获取门店列表数量 + * @return int + * @author admin + * @date 2024/05/31 17:45 + */ + public function count(): int + { + $where[]=['is_show','=',YesNoEnum::YES]; + return SystemStore::where($this->searchWhere)->where($where)->count(); + } + +} \ No newline at end of file diff --git a/app/api/lists/user/UserAddressList.php b/app/api/lists/user/UserAddressList.php new file mode 100644 index 000000000..b6bacad2c --- /dev/null +++ b/app/api/lists/user/UserAddressList.php @@ -0,0 +1,63 @@ +request->userId; + if(!$user_id) return []; + return UserAddress::where($this->searchWhere)->where('uid',$user_id) + ->field('address_id,real_name,detail,phone,is_default') + ->limit($this->limitOffset, $this->limitLength) + ->order(['address_id' => 'desc']) + ->select() + ->toArray(); + } + + + /** + * @notes 获取地址数量 + * @return int + * @date 2024/04/27 11:26 + */ + public function count(): int + { + $user_id=$this->request->userId; + return UserAddress::where($this->searchWhere)->where('uid',$user_id)->count(); + } + +} \ No newline at end of file diff --git a/app/api/lists/user/UserFeedbackLists.php b/app/api/lists/user/UserFeedbackLists.php new file mode 100644 index 000000000..7d841d1a4 --- /dev/null +++ b/app/api/lists/user/UserFeedbackLists.php @@ -0,0 +1,64 @@ + ['uid'], + '%like%' => ['name', 'contact'], + ]; + } + + + /** + * @notes 获取用户反馈表列表 + * @return array + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + * @author likeadmin + * @date 2024/05/13 16:56 + */ + public function lists(): array + { + $uid = $this->request->userInfo['user_id']; + return UserFeedback::where($this->searchWhere)->where('uid',$uid) + ->field(['id', 'uid', 'content', 'images', 'name', 'contact','create_time']) + ->limit($this->limitOffset, $this->limitLength) + ->order(['id' => 'desc']) + ->select()->each(function($data){ + $user = User::field('nickname')->where('id',$data['uid'])->findOrEmpty(); + $data['user_name'] = !$user->isEmpty() ? $user['nickname'] : ''; + }) + ->toArray(); + } + + + /** + * @notes 获取用户反馈表数量 + * @return int + * @author likeadmin + * @date 2024/05/13 16:56 + */ + public function count(): int + { + return UserFeedback::where($this->searchWhere)->count(); + } + + } \ No newline at end of file diff --git a/app/api/logic/LoginLogic.php b/app/api/logic/LoginLogic.php index a4c90bef4..a697e8d1b 100644 --- a/app/api/logic/LoginLogic.php +++ b/app/api/logic/LoginLogic.php @@ -16,6 +16,7 @@ namespace app\api\logic; use app\common\cache\WebScanLoginCache; use app\common\logic\BaseLogic; +use app\common\model\system_store\SystemStoreStaff; use app\api\service\{UserTokenService, WechatUserService}; use app\common\enum\{LoginEnum, user\UserTerminalEnum, YesNoEnum}; use app\common\service\{ @@ -229,6 +230,16 @@ class LoginLogic extends BaseLogic // 更新登录信息 self::updateLoginInfo($userInfo['id']); + //判断是不是员工 + $userInfo['is_staff'] = 0; + $userInfo['store_id'] = 0; + if($userInfo['mobile']){ + $check = SystemStoreStaff::where('phone',$userInfo['mobile'])->find()??[]; + if ($check){ + $userInfo['is_staff'] = 1; + $userInfo['store_id'] = $check['store_id']; + } + } Db::commit(); return $userInfo; diff --git a/app/api/logic/user/AddressLogic.php b/app/api/logic/user/AddressLogic.php new file mode 100644 index 000000000..a1efca0c1 --- /dev/null +++ b/app/api/logic/user/AddressLogic.php @@ -0,0 +1,106 @@ +update(['is_default'=>0]); + }else{ + $params['is_default']=1; + } + $id=UserAddress::insertGetId([ + 'uid' => $params['uid'], + 'real_name' => $params['real_name'], + 'phone' => $params['phone'], + 'detail' => $params['detail'], + 'is_default' => $params['is_default'], + ]); + Db::commit(); + return $id; + } catch (\Exception $e) { + Db::rollback(); + self::setError($e->getMessage()); + return false; + } + } + + + /** + * @notes 编辑地址表 + * @param array $params + * @return bool + * @author likeadmin + * @date 2024/04/24 10:37 + */ + public static function edit(array $params): bool + { + Db::startTrans(); + try { + if($params['is_default']==1){ + UserAddress::where('uid',$params['uid'])->update(['is_default'=>0]); + } + $data = [ + 'real_name' => $params['real_name'], + 'phone' => $params['phone'], + 'detail' => $params['detail'], + 'is_default' => $params['is_default'], + ]; + UserAddress::where('uid', $params['uid'])->where('address_id', $params['address_id'])->update($data); + Db::commit(); + return true; + } catch (\Exception $e) { + Db::rollback(); + self::setError($e->getMessage()); + return false; + } + } + + + /** + * @notes 删除地址表 + * @param array $params + * @return bool + * @author likeadmin + * @date 2024/04/24 10:37 + */ + public static function delete(array $params): bool + { + return UserAddress::destroy($params['address_id']); + } + + + /** + * @notes 获取购物车表详情 + * @param $params + * @return array + * @author likeadmin + * @date 2024/04/24 10:37 + */ + public static function detail($params): array + { + return UserAddress::field('address_id,real_name,phone,detail,is_default')->findOrEmpty($params['address_id'])->toArray(); + } +} diff --git a/app/api/logic/user/UserFeedbackLogic.php b/app/api/logic/user/UserFeedbackLogic.php new file mode 100644 index 000000000..42cba90e6 --- /dev/null +++ b/app/api/logic/user/UserFeedbackLogic.php @@ -0,0 +1,38 @@ + $uid, + 'content' => $params['content'], + 'images' => $params['images'] ? json_encode($params['images']) : null, + 'name' => $params['name'], + 'contact' => $params['contact'], + 'create_time' => time(), + ]); + Db::commit(); + return true; + } catch (\Exception $e) { + Db::rollback(); + self::setError($e->getMessage()); + return false; + } + } + } \ No newline at end of file diff --git a/app/api/logic/user/UserLogic.php b/app/api/logic/user/UserLogic.php new file mode 100644 index 000000000..939903a38 --- /dev/null +++ b/app/api/logic/user/UserLogic.php @@ -0,0 +1,59 @@ +getUserPhoneNumber($params['code']); + $phoneNumber = $response['phone_info']['purePhoneNumber'] ?? ''; + if (empty($phoneNumber)) { + throw new \Exception('获取手机号码失败'); + } + + $user = User::where([ + ['mobile', '=', $phoneNumber], + ['id', '<>', $params['user_id']] + ])->findOrEmpty(); + + if (!$user->isEmpty()) { + throw new \Exception('手机号已被其他账号绑定'); + } + + // 绑定手机号 + User::update([ + 'id' => $params['user_id'], + 'mobile' => $phoneNumber + ]); + + return true; + } catch (\Exception $e) { + self::setError($e->getMessage()); + return false; + } + } + + +} \ No newline at end of file diff --git a/app/api/validate/PayValidate.php b/app/api/validate/PayValidate.php new file mode 100644 index 000000000..87d2c4068 --- /dev/null +++ b/app/api/validate/PayValidate.php @@ -0,0 +1,54 @@ + 'require', + 'pay_way' => 'require|in:' . PayEnum::BALANCE_PAY . ',' . PayEnum::WECHAT_PAY . ',' . PayEnum::ALIPAY, + 'order_id' => 'require' + ]; + + + protected $message = [ + 'from.require' => '参数缺失', + 'pay_way.require' => '支付方式参数缺失', + 'pay_way.in' => '支付方式参数错误', + 'order_id.require' => '订单参数缺失' + ]; + + + /** + * @notes 支付方式场景 + * @return PayValidate + * @author 段誉 + * @date 2023/2/24 17:43 + */ + public function scenePayway() + { + return $this->only(['from', 'order_id']); + } + + + /** + * @notes 支付状态 + * @return PayValidate + * @author 段誉 + * @date 2023/3/1 16:17 + */ + public function sceneStatus() + { + return $this->only(['from', 'order_id']); + } + + + +} \ No newline at end of file diff --git a/app/api/validate/UserAddressValidate.php b/app/api/validate/UserAddressValidate.php new file mode 100644 index 000000000..30a1360b6 --- /dev/null +++ b/app/api/validate/UserAddressValidate.php @@ -0,0 +1,93 @@ + 'require', + 'phone' => 'require', + 'detail' => 'require', + 'address_id' => 'require', + "is_default"=>"require|in:0,1" + + ]; + + + /** + * 参数描述 + * @var string[] + */ + protected $field = [ + + 'real_name' => '收货人姓名', + 'phone' => '收货人电话', + 'detail' => '收货人详细地址', + 'address_id' => '地址id', + "is_default"=>"默认地址" + + ]; + + + /** + * @notes 添加场景 + * @return UserAddressValidate + * @author likeadmin + * @date 2024/04/28 17:28 + */ + public function sceneAdd() + { + return $this->only(['real_name','phone','detail']); + } + + + /** + * @notes 编辑场景 + * @return UserAddressValidate + * @author likeadmin + * @date 2024/04/28 17:28 + */ + public function sceneEdit() + { + return $this->only(['real_name','phone','detail','address_id']); + } + + + /** + * @notes 删除场景 + * @return UserAddressValidate + * @author likeadmin + * @date 2024/04/28 17:28 + */ + public function sceneDelete() + { + return $this->only(['address_id']); + } + + + /** + * @notes 详情场景 + * @return UserAddressValidate + * @author likeadmin + * @date 2024/04/28 17:28 + */ + public function sceneDetail() + { + return $this->only(['address_id']); + } + +} \ No newline at end of file diff --git a/app/common/model/cate/Cate.php b/app/common/model/cate/Cate.php new file mode 100644 index 000000000..cb2506c7e --- /dev/null +++ b/app/common/model/cate/Cate.php @@ -0,0 +1,29 @@ +hasOne(User::class,'id','uid')->bind(['mer_real_name'=>'real_name']); + } +} \ No newline at end of file diff --git a/app/common/model/store_branch_product/StoreBranchProduct.php b/app/common/model/store_branch_product/StoreBranchProduct.php new file mode 100644 index 000000000..4f988320e --- /dev/null +++ b/app/common/model/store_branch_product/StoreBranchProduct.php @@ -0,0 +1,22 @@ + $id) { + StoreProductLogic::copy($data['product_id'],$id); + } + } + public function onConsumeFailure(\Throwable $e, $package) + { + $package['max_attempts']=0; + Log::error('复制商品失败product_id:'.$package['data']['product_id']); + return $package; + } +} \ No newline at end of file diff --git a/config/pay/ali/alipayCertPublicKey_RSA2.crt b/config/pay/ali/alipayCertPublicKey_RSA2.crt new file mode 100644 index 000000000..4f9220901 --- /dev/null +++ b/config/pay/ali/alipayCertPublicKey_RSA2.crt @@ -0,0 +1,43 @@ +-----BEGIN CERTIFICATE----- +MIIDsjCCApqgAwIBAgIQICQFJaxJICk3sZeM5O23ADANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UE +BhMCQ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Q4EFgQUSqHkYINtUSAtDPnS8Xoy +oP9p7qEwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwDQYJKoZIhvcNAQELBQADggIB +AIQ8TzFy4bVIVb8+WhHKCkKNPcJe2EZuIcqvRoi727lZTJOfYy/JzLtckyZYfEI8J0lasZ29wkTt +a1IjSo+a6XdhudU4ONVBrL70U8Kzntplw/6TBNbLFpp7taRALjUgbCOk4EoBMbeCL0GiYYsTS0mw +7xdySzmGQku4GTyqutIGPQwKxSj9iSFw1FCZqr4VP4tyXzMUgc52SzagA6i7AyLedd3tbS6lnR5B +L+W9Kx9hwT8L7WANAxQzv/jGldeuSLN8bsTxlOYlsdjmIGu/C9OWblPYGpjQQIRyvs4Cc/mNhrh+ +14EQgwuemIIFDLOgcD+iISoN8CqegelNcJndFw1PDN6LkVoiHz9p7jzsge8RKay/QW6C03KNDpWZ +EUCgCUdfHfo8xKeR+LL1cfn24HKJmZt8L/aeRZwZ1jwePXFRVtiXELvgJuM/tJDIFj2KD337iV64 +fWcKQ/ydDVGqfDZAdcU4hQdsrPWENwPTQPfVPq2NNLMyIH9+WKx9Ed6/WzeZmIy5ZWpX1TtTolo6 +OJXQFeItMAjHxW/ZSZTok5IS3FuRhExturaInnzjYpx50a6kS34c5+c8hYq7sAtZ/CNLZmBnBCFD +aMQqT8xFZJ5uolUaSeXxg7JFY1QsYp5RKvj4SjFwCGKJ2+hPPe9UyyltxOidNtxjaknOCeBHytOr +-----END CERTIFICATE----- diff --git a/config/pay/ali/alipayRootCert.crt b/config/pay/ali/alipayRootCert.crt new file mode 100644 index 000000000..76417c538 --- /dev/null +++ b/config/pay/ali/alipayRootCert.crt @@ -0,0 +1,88 @@ +-----BEGIN CERTIFICATE----- +MIIBszCCAVegAwIBAgIIaeL+wBcKxnswDAYIKoEcz1UBg3UFADAuMQswCQYDVQQG +EwJDTjEOMAwGA1UECgwFTlJDQUMxDzANBgNVBAMMBlJPT1RDQTAeFw0xMjA3M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KgWKYfcTGdbPB1MCAwEAAaNjMGEwHQYDVR0OBBYEFG/oAMxTVe7y0+408CTAK8hA +uTyRMB8GA1UdIwQYMBaAFG/oAMxTVe7y0+408CTAK8hAuTyRMA8GA1UdEwEB/wQF +MAMBAf8wDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQBLnUTfW7hp +emMbuUGCk7RBswzOT83bDM6824EkUnf+X0iKS95SUNGeeSWK2o/3ALJo5hi7GZr3 +U8eLaWAcYizfO99UXMRBPw5PRR+gXGEronGUugLpxsjuynoLQu8GQAeysSXKbN1I +UugDo9u8igJORYA+5ms0s5sCUySqbQ2R5z/GoceyI9LdxIVa1RjVX8pYOj8JFwtn +DJN3ftSFvNMYwRuILKuqUYSHc2GPYiHVflDh5nDymCMOQFcFG3WsEuB+EYQPFgIU +1DHmdZcz7Llx8UOZXX2JupWCYzK1XhJb+r4hK5ncf/w8qGtYlmyJpxk3hr1TfUJX +Yf4Zr0fJsGuv +-----END CERTIFICATE----- \ No newline at end of file diff --git a/config/pay/ali/appCertPublicKey_2021004146699603.crt b/config/pay/ali/appCertPublicKey_2021004146699603.crt new file mode 100644 index 000000000..14bfbaeb6 --- /dev/null +++ b/config/pay/ali/appCertPublicKey_2021004146699603.crt @@ -0,0 +1,23 @@ +-----BEGIN CERTIFICATE----- +MIIEoDCCA4igAwIBAgIQICQFJYrgve0jW7XDuTjfnzANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UE +BhMCQ04xFjAUBgNVBAoMDUFudCBGaW5hbmNpYWwxIDAeBgNVBAsMF0NlcnRpZmljYXRpb24gQXV0 +aG9yaXR5MTkwNwYDVQQDDDBBbnQgRmluYW5jaWFsIENlcnRpZmljYXRpb24gQXV0aG9yaXR5IENs +YXNzIDEgUjEwHhcNMjQwNTI1MDIxNjQ0WhcNMjkwNTI0MDIxNjQ0WjBoMQswCQYDVQQGEwJDTjEt +MCsGA1UECgwk5rO45bee6YeM5rW35Yac5Lia56eR5oqA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AFcDW3okDSKYvr8tJNC3MNyGY4dd6YxouE3738HtlYf/iGkN0ntQ +NEayluq3tRI+XE6AYrU6FYvXwWAGur/UqQTyKYAT0j2UE5VBfwC7/qpFBK+13oe8JvqdgLJY6BtB +nAnLaP1Z5RY5JnmUgzXD/pCkIZu5U3WS9hFcAxCrSiZmU4+CVRTTfY7d/DU89epc +-----END CERTIFICATE----- \ No newline at end of file diff --git a/config/pay/wechat/82fdc3426e3aeb9e5df91a9547ac5ef3.pem b/config/pay/wechat/82fdc3426e3aeb9e5df91a9547ac5ef3.pem new file mode 100644 index 000000000..cd431dc3d --- /dev/null +++ b/config/pay/wechat/82fdc3426e3aeb9e5df91a9547ac5ef3.pem @@ -0,0 +1,25 @@ +-----BEGIN CERTIFICATE----- +MIIEKDCCAxCgAwIBAgIUYAGG3fxXIyJ8FvMcIWFHBYwI1oUwDQYJKoZIhvcNAQEL +BQAwXjELMAkGA1UEBhMCQ04xEzARBgNVBAoTClRlbnBheS5jb20xHTAbBgNVBAsT +FFRlbnBheS5jb20gQ0EgQ2VudGVyMRswGQYDVQQDExJUZW5wYXkuY29tIFJvb3Qg +Q0EwHhcNMjMwOTI1MDE1NjI1WhcNMjgwOTIzMDE1NjI1WjCBgTETMBEGA1UEAwwK +MTY1NDI3NDg2NzEbMBkGA1UECgwS5b6u5L+h5ZWG5oi357O757ufMS0wKwYDVQQL +DCTms7jlt57ph4zmtbflhpzkuJrnp5HmioDmnInpmZDlhazlj7gxCzAJBgNVBAYM +AkNOMREwDwYDVQQHDAhTaGVuWmhlbjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC +AQoCggEBANTeTUe6k55sj+jlEN1wgPyjRw8SMQ8df5xdt6P9Xe29wR+10YHtJrpo +//WRg6MNDk3akQoIq1+Nb6ADdUpwTKpeTlDaJw9MtP5sHHlfe3KUHDWUq128Fo9z +gLXoZ4BVQ0YibpBJgeTpUVBNxM7NlTMBGwL9BkK0v37arYkfUuJ0VCcGj5kOfFnH +4/CZlOAwSj/FYvQCDJrnP2LbXYLoObnf5GaAOMwbvNAJvkLmLXIAufWgPrXu5OwG +ZC0IOK01IVjLQhW6T+VPyyeKWK4xh9FLQ/vkNsZsGwlpkN2frp9F38ZCeTcKFqeP +36WEU5E0WCF3T2zubwNbl56CpENrDQMCAwEAAaOBuTCBtjAJBgNVHRMEAjAAMAsG +A1UdDwQEAwID+DCBmwYDVR0fBIGTMIGQMIGNoIGKoIGHhoGEaHR0cDovL2V2Y2Eu +aXRydXMuY29tLmNuL3B1YmxpYy9pdHJ1c2NybD9DQT0xQkQ0MjIwRTUwREJDMDRC +MDZBRDM5NzU0OTg0NkMwMUMzRThFQkQyJnNnPUhBQ0M0NzFCNjU0MjJFMTJCMjdB +OUQzM0E4N0FEMUNERjU5MjZFMTQwMzcxMA0GCSqGSIb3DQEBCwUAA4IBAQBFY145 +P8GFVelCSY+T5a1Wqy/J0EphwBqAD0GiWCvV64vSl1Xv/hQoNh8b5Kco6DCsJMOW +jSde17gqDYPub7j1G7oKWIdOfYb/TAE/HEmAou+KQU53mtT08bEH3Ej2wXpH9O6e +i/fR656fq+FmiiK/But0+VPssa7mpuwbMjHA03DjcKfk0jrWfr1KI1uUOPS2SheW +zbMyUAludud50RTu9DRFeDP/6HUDqHcsCpdjy+yQMobrtsrmphpVKdBTI0k8/zpB +4pqyfZ12PC30Gpqyr0iPu/oMh5QQAjrzCwHc0FeA+a/06YhndX9rHx3ryD58RYBs +nkuymMJUPd5+A5Xm +-----END CERTIFICATE----- \ No newline at end of file diff --git a/config/pay/wechat/c208f16ad08e6d2516e0b73e6d0ab8da.pem b/config/pay/wechat/c208f16ad08e6d2516e0b73e6d0ab8da.pem new file mode 100644 index 000000000..9b0615a04 --- /dev/null +++ b/config/pay/wechat/c208f16ad08e6d2516e0b73e6d0ab8da.pem @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQDU3k1HupOebI/o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AHyPvnvitxAm2lZw149bSfgOwgbDsTg07 +DKO6cYTucOQqXNHSk4/ADC5rz1BRQEsXjIwiECBh4Yq2D6HQwAXwgwuh3vt+L21V +Ed8IgzfJD+iN1WLj4khd9cU5CDDNk4/l5MW4cVgEjrdUt9GT58wQLrQdAoGAVgGs +JOzsgEip2GkHp/NVdpW1ZXCe4iYg8s+L2DZejUuPoMWc3lkv3rShgoHWFuvD/g8P ++G0oXMGBPPwc2gFJ9do1fw3UUTodYZpugBevsWz//kA/N+Y/fus7boEABWeq4l3W +omBYNhsbZ6Tn+4X8YQY0G9RLFW793MftSAR7PEcCgYAh99cfwfNV36/nFIt8E18w +yzWb5HFLZ29eFjXgbmOaq4h2+P5Wor+E2v6OD154kUWm5oYNiPtBs0GHrvtjl2TW +tuBjU58+ejl2Ae6678Yxj+IlH8NRJf3pR6gDST/YHhVRv8TuBFeKT+nZ97t6HsJT +GE1Me2UOnbIHGImqvDlOvA== +-----END PRIVATE KEY----- \ No newline at end of file diff --git a/config/payment.php b/config/payment.php index 9b81ce6f3..7c5ba66c7 100644 --- a/config/payment.php +++ b/config/payment.php @@ -13,11 +13,11 @@ return [ // 必填-应用私钥 字符串或路径 'app_secret_cert' => 'MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCktKWIoqSZ8BoSpALMsvTEsEQ1kF++wBeneams0Q17LvqGDBgiGuuICU0tnhBrjEkJFIw+5ApiHdkwbjFRqDqXyNj7B9fMBWp+QeHf6KvmRsPOHZegyvmQlqvMYf6hF4OwVKDrtVi6I1hVdrwf35h8KEGh4QM0WyXno2bJ7OVQDL49enrG7dXZQkwnwiluuxgjKphC2WYHCERGiYbrRKWXtQmzivjw7YTtfSXvypp8N3pSWXkWeLqpGGK3GG3pcUu4U+y4RFknnzSpiv20EJ6gw3pjUDkzexJoGh9byFOMoRVTJpIV8iTshdozd69ny5FjmIoXIouGCjdwp6M+XCXVAgMBAAECggEAJ1Dn4sHQQN7Lmn+EG5D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Pt8vs39qRfyXwoez2dWbK9ZUmU3/DTZBtL/1OmpDV2yPYi+xpipgzETB44mQnpcAcvaxU59j0oZQxXsWXHKNfOBzO2KgrReHnY7oUurPPq1A76yEcGmtn', // 必填-应用公钥证书 路径 - 'app_public_cert_path' => runtime_path() . '/cert/ali/appCertPublicKey_2021004146699603.crt', + 'app_public_cert_path' => config_path('pay') . '/ali/appCertPublicKey_2021004146699603.crt', // 必填-支付宝公钥证书 路径 - 'alipay_public_cert_path' => runtime_path() . '/cert/ali/alipayCertPublicKey_RSA2.crt', + 'alipay_public_cert_path' => config_path('pay') . '/ali/alipayCertPublicKey_RSA2.crt', // 必填-支付宝根证书 路径 - 'alipay_root_cert_path' => runtime_path() . '/cert/ali/alipayRootCert.crt', + 'alipay_root_cert_path' => config_path('pay') . '/ali/alipayRootCert.crt', // 选填-同步回调地址 'return_url' => 'https://erp.lihaink.cn/api/pay/alipay_return', // 选填-异步回调地址 @@ -37,9 +37,9 @@ return [ // 必填-商户秘钥 'mch_secret_key' => '7E00D167C9793006C93F4FB4CF65BCC2', // 必填-商户私钥 字符串或路径 - 'mch_secret_cert' => runtime_path() . '/cert/c208f16ad08e6d2516e0b73e6d0ab8da.pem', + 'mch_secret_cert' => config_path('pay') . '/wechat/c208f16ad08e6d2516e0b73e6d0ab8da.pem', // 必填-商户公钥证书路径 - 'mch_public_cert_path' => runtime_path() . '/cert/82fdc3426e3aeb9e5df91a9547ac5ef3.pem', + 'mch_public_cert_path' => config_path('pay') . '/wechat/82fdc3426e3aeb9e5df91a9547ac5ef3.pem', // 必填 'notify_url' => 'https://erp.lihaink.cn/api/pay/notifyMnp', // 选填-公众号 的 app_id