From e856c4c32af5bc41abbc11edde56c4da7515e00e Mon Sep 17 00:00:00 2001 From: luofei <604446095@qq.com> Date: Mon, 5 Feb 2024 10:08:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=95=86=E6=88=B7=E9=82=80?= =?UTF-8?q?=E8=AF=B7=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/api/server/Store.php | 35 +++++++++++++++++++++++++++++ route/api.php | 1 + 2 files changed, 36 insertions(+) diff --git a/app/controller/api/server/Store.php b/app/controller/api/server/Store.php index 45dc89df..94db6d68 100644 --- a/app/controller/api/server/Store.php +++ b/app/controller/api/server/Store.php @@ -2,9 +2,11 @@ namespace app\controller\api\server; +use app\common\model\system\merchant\FinancialRecord; use app\controller\api\Common; use crmeb\basic\BaseController; use think\App; +use think\db\Query; class Store extends BaseController { @@ -28,4 +30,37 @@ class Store extends BaseController return app('json')->success(['url' => $data]); } + + /** + * 邀请记录 + * @return mixed + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + */ + public function record() + { + [$page, $limit] = $this->getPage(); + $query = FinancialRecord::field('order_sn,number') + ->where('mer_id', $this->merId) + ->where('financial_type', 'commission_to_promoter') + ->with(['orderInfo' => function (Query $query) { + $query->field('pay_price,real_name,uid,order_sn')->with(['user' => function (Query $query) { + $query->field('nickname,uid'); + }]); + }]); + $count = $query->count(); + $result = $query->page($page, $limit)->select()->toArray(); + $list = []; + foreach ($result as $item) { + $list[] = [ + 'nickname' => $item['orderInfo']['user']['nickname'], + 'uid' => $item['orderInfo']['uid'], + 'order_amount' => $item['orderInfo']['pay_price'], + 'commission' => $item['number'], + ]; + } + return app('json')->success(['count' => $count, 'list' => $list]); + } + } diff --git a/route/api.php b/route/api.php index 777d1e55..6f106971 100755 --- a/route/api.php +++ b/route/api.php @@ -300,6 +300,7 @@ Route::group('api/', function () { //客服商品管理 Route::group('server/:merId', function () { Route::get('qrcode', 'Store/qrcode'); + Route::get('record', 'Store/record'); //商品 Route::post('product/create', 'StoreProduct/create'); Route::post('product/update/:id', 'StoreProduct/update');