添加商户邀请记录
This commit is contained in:
parent
a74c1308b6
commit
e856c4c32a
@ -2,9 +2,11 @@
|
|||||||
|
|
||||||
namespace app\controller\api\server;
|
namespace app\controller\api\server;
|
||||||
|
|
||||||
|
use app\common\model\system\merchant\FinancialRecord;
|
||||||
use app\controller\api\Common;
|
use app\controller\api\Common;
|
||||||
use crmeb\basic\BaseController;
|
use crmeb\basic\BaseController;
|
||||||
use think\App;
|
use think\App;
|
||||||
|
use think\db\Query;
|
||||||
|
|
||||||
class Store extends BaseController
|
class Store extends BaseController
|
||||||
{
|
{
|
||||||
@ -28,4 +30,37 @@ class Store extends BaseController
|
|||||||
return app('json')->success(['url' => $data]);
|
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]);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -300,6 +300,7 @@ Route::group('api/', function () {
|
|||||||
//客服商品管理
|
//客服商品管理
|
||||||
Route::group('server/:merId', function () {
|
Route::group('server/:merId', function () {
|
||||||
Route::get('qrcode', 'Store/qrcode');
|
Route::get('qrcode', 'Store/qrcode');
|
||||||
|
Route::get('record', 'Store/record');
|
||||||
//商品
|
//商品
|
||||||
Route::post('product/create', 'StoreProduct/create');
|
Route::post('product/create', 'StoreProduct/create');
|
||||||
Route::post('product/update/:id', 'StoreProduct/update');
|
Route::post('product/update/:id', 'StoreProduct/update');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user