diff --git a/app/admin/controller/merchant/system/merchant/Merchant.php b/app/admin/controller/merchant/system/merchant/Merchant.php new file mode 100644 index 0000000..425274d --- /dev/null +++ b/app/admin/controller/merchant/system/merchant/Merchant.php @@ -0,0 +1,27 @@ +margin = $margin; + // $this->margin = $margin; + $this->path = [ + 'index' => 'merchant/system/merchant/margin/list', + 'read' => 'merchant/system/merchant/margin/read', + 'edit' => 'merchant/system/merchant/margin/edit' + ]; + } + + public function Index() + { + return View($this->path['index']); } /** - * 显示资源列表 + * 显示保证金列表 * * @return \think\Response */ - public function lst() + public function lst(ServeOrderModel $order) { - echo 'margin list'; + $params = get_params(); + $page = empty($params['page'])? 1 : (int)$params['page']; + $limit = empty($params['limit'])? (int)get_config('app . page_size') : (int)$params['limit']; + $where = ['date','keyword','is_trader','category_id','type_id']; + $where['type'] = 10;//10==保证金 + + $data = $order->GetList($where, $page, $limit); + + return to_assign(0,'success', $data['data']=$data['list']); } /** - * 显示创建资源表单页. - * - * @return \think\Response + * 获取保证金扣费记录 record */ - public function create() + public function getMarginLst() { - // + return View($this->path['read']); } + /** + * 设置扣减保证金表单 + */ + public function setMarginForm() + { + return View($this->path['edit']); + } + + /** + * 设置扣减保证金 + */ + public function setMargin() + { + echo 'fail'; + } + + /** * 保存新建的资源 * @@ -92,14 +126,4 @@ class MerchantMargin extends BaseController // } - /** - * 删除指定资源 - * - * @param int $id - * @return \think\Response - */ - public function delete($id) - { - // - } } diff --git a/app/admin/route/merchant.php b/app/admin/route/merchant.php index 1432f04..4d331a7 100644 --- a/app/admin/route/merchant.php +++ b/app/admin/route/merchant.php @@ -91,22 +91,29 @@ Route::group(function(){ //店铺保证金 Route::group('/margin', function(){ + + // 主页 + Route::get('index', '/index')->name('systemMerchantMarginIndex' + )->option([ + '_alias'=>'主页列表 ', + ]); + //缴纳记录 Route::get('lst', '/lst')->name('systemMerchantMarginLst')->option([ '_alias' => '缴纳记录', ]); //扣费记录 - Route::get('list/:id', '/getMarginLst')->name('systemMarginList')->option([ + Route::get('read', '/getMarginLst')->name('systemMarginList')->option([ '_alias' => '扣费记录', ]); //扣除保证金 - Route::get('set/:id/form', '/setMarginForm')->name('systemMarginSetForm')->option([ + Route::get('form', '/setMarginForm')->name('systemMarginSetForm')->option([ '_alias' => '扣除保证金表单', '_auth' => false, '_form' => 'systemMarginSet', ]); - Route::post('set', '/setMargin')->name('systemMarginSet')->option([ + Route::post('reduct', '/setMargin')->name('systemMarginSet')->option([ '_alias' => '扣除保证金', ]); })->prefix('merchant.system.merchant.MerchantMargin')->option([ diff --git a/app/admin/view/merchant/system/merchant/margin/edit.html b/app/admin/view/merchant/system/merchant/margin/edit.html new file mode 100644 index 0000000..5cc27c6 --- /dev/null +++ b/app/admin/view/merchant/system/merchant/margin/edit.html @@ -0,0 +1,134 @@ +{extend name="common/base"/} +{block name="style"} + +{/block} + +{block name="body"} +
+

保证金扣费

+ + + + + + + + + + + + + + + + + + + + + + +
店铺类型名称* + +
店铺类型要求 + +
店铺保证金 + + + + + + + + + +
+
+ + +
+
+ + 单位:元
+
其它说明 + +
+ +
+ + +
+
+{/block} + + + +{block name="script"} + + + +{/block} + diff --git a/app/admin/view/merchant/system/merchant/margin/list.html b/app/admin/view/merchant/system/merchant/margin/list.html new file mode 100644 index 0000000..3ef43ca --- /dev/null +++ b/app/admin/view/merchant/system/merchant/margin/list.html @@ -0,0 +1,372 @@ +{extend name="common/base"/} + +{block name="body"} + + +
+ + + +
+ +
+
+ +
+ +
+
+ +
+
-
+
+ +
+
+
+ +
+
+ +
+ + +
+
+ +
+ +
+ +
+ + +
+
+ +
+ +
+
+
+ +
+
+ +
+ +
+
+
+ +
+ +
+ + +
+
+ +
+ +
+
+
+ +
+
+ +
+ +
+
+
+ +
+
+
+ + + + + +
+ +
+ + +
+ +
+
+ + +
+
+ +
+
+ +
+
+
+ + + + +
+ + + + + + + + + +{/block} + + +{block name="script"} + +{/block} + \ No newline at end of file diff --git a/app/admin/view/merchant/system/merchant/margin/read.html b/app/admin/view/merchant/system/merchant/margin/read.html new file mode 100644 index 0000000..fb1ffb1 --- /dev/null +++ b/app/admin/view/merchant/system/merchant/margin/read.html @@ -0,0 +1,108 @@ +{extend name="common/base"/} + +{block name="body"} + +
+ +
+ +
+ + +
+ +
+
+
+
+ +
+ +{/block} + + +{block name="script"} + +{/block} + \ No newline at end of file diff --git a/app/admin/view/merchant/system/merchant/margin/read_refund.html b/app/admin/view/merchant/system/merchant/margin/read_refund.html new file mode 100644 index 0000000..6bb7943 --- /dev/null +++ b/app/admin/view/merchant/system/merchant/margin/read_refund.html @@ -0,0 +1,63 @@ +{extend name="common/base"/} +{block name="style"} + +{/block} + +{block name="body"} +
+

查看店铺类型

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
店铺类型名称
店铺类型要求 + +
店铺保证金
店铺权限 + + +
其它说明 + +
创建时间 + {$detail.create_time} +
修改时间 + {$detail.update_time} +
+
+{/block} + \ No newline at end of file diff --git a/app/admin/view/merchant/system/merchant/type/add.html b/app/admin/view/merchant/system/merchant/type/add.html index 25d57e3..e2ecbc6 100644 --- a/app/admin/view/merchant/system/merchant/type/add.html +++ b/app/admin/view/merchant/system/merchant/type/add.html @@ -20,7 +20,7 @@ 店铺类型名称* + autocomplete="off" placeholder="请输入商品名称" class="layui-input" value="{$detail.type_name}"> diff --git a/app/admin/view/merchant/system/merchant/type/read.html b/app/admin/view/merchant/system/merchant/type/read.html index 16d33e0..1145f28 100644 --- a/app/admin/view/merchant/system/merchant/type/read.html +++ b/app/admin/view/merchant/system/merchant/type/read.html @@ -7,7 +7,7 @@ {block name="body"}
-

文章详情

+

查看店铺类型

diff --git a/app/common/model/merchant/system/merchant/FinancialRecord.php b/app/common/model/merchant/system/merchant/FinancialRecord.php new file mode 100644 index 0000000..3059e9f --- /dev/null +++ b/app/common/model/merchant/system/merchant/FinancialRecord.php @@ -0,0 +1,14 @@ +hasOne(MerchantType::class, 'mer_type_id', 'type_id'); + } + + public function typeName() + { + return $this->merchantType()->bind(['type_name']); + } +} diff --git a/app/common/model/merchant/system/merchant/MerchantAdmin.php b/app/common/model/merchant/system/merchant/MerchantAdmin.php new file mode 100644 index 0000000..03ec84b --- /dev/null +++ b/app/common/model/merchant/system/merchant/MerchantAdmin.php @@ -0,0 +1,14 @@ +hasOne(Merchant::class,'mer_id','mer_id'); + } + + // 关联用户表 + public function userInfo() + { + return $this->hasOne(User::class,'mer_id','ud'); + } + + function GetList($where, int $page, int $limit) + { + $where['is_del'] = 0; + + $query = self::Search($where)->with([ + 'merchant' => function($query){ + $query->with(['merchantType']); + $query->field('mer_id,mer_name,is_trader,mer_avatar,type_id,mer_phone,mer_address,is_margin,margin,real_name,ot_margin'); + } + ])->order('ServeOrder.create_time DESC'); + + $count = $query->count(); + $list = $query->page((int)$page, (int)$limit)->select(); + + return compact('count','list'); + } + + + /** + * @param ServeOrderRepository $orderRepository + * + * @return \think\response\Json + */ + public function Search($where):Query + { + $query = self::hasWhere('merchant',function($query) use($where) { + + $query->when(isset($where['keyword']) && $where['keyword'] !== '', function ($query) use($where){ + $query->whereLike('mer_keyword|real_name|mer_name',"%{$where['keyword']}%"); + }); + $query->when(isset($where['is_trader']) && $where['is_trader'] !== '', function ($query) use($where){ + $query->where('is_trader',$where['is_trader']); + }); + $query->when(isset($where['category_id']) && $where['category_id'] !== '', function ($query) use($where){ + $query->where('category_id',$where['category_id']); + }); + $query->when(isset($where['type_id']) && $where['type_id'] !== '', function ($query) use($where){ + $query->where('type_id',$where['type_id']); + }); + $query->where('is_del',0); + }); + + $query->when(isset($where['type']) && $where['type'] !== '', function ($query) use($where){ + $query->where('ServeOrder.type',$where['type']); + }); + + $query->when(isset($where['date']) && $where['date'] !== '', function ($query) use($where){ + getModelTime($query,$where['date'],'ServeOrder.create_time'); + }); + + $query->when(isset($where['mer_id']) && $where['mer_id'] !== '', function ($query) use($where){ + $query->where('ServeOrder.mer_id',$where['mer_id']); + }); + + $query->when(isset($where['status']) && $where['status'] !== '', function ($query) use($where){ + $query->where('ServeOrder.status',$where['status']); + }); + + $query->when(isset($where['is_del']) && $where['is_del'] !== '', function ($query) use($where){ + $query->where('ServeOrder.is_del',$where['is_del']); + }); + + return $query; + } +} diff --git a/app/common/model/merchant/user/User.php b/app/common/model/merchant/user/User.php new file mode 100644 index 0000000..a0031f5 --- /dev/null +++ b/app/common/model/merchant/user/User.php @@ -0,0 +1,15 @@ +
店铺类型名称