wesmiler 2 years ago
parent
commit
aa72d24d8b

+ 0 - 37
app/Http/Controllers/Api/v1/MerchantController.php

@@ -106,43 +106,6 @@ class MerchantController extends webApp
 
     }
 
-    /**
-     * 申请入驻审核
-     * @return array
-     */
-    public function applyConfirm(MerchantValidator $validator)
-    {
-        $params = request()->all();
-        $params = $validator->check($params, 'info');
-        if (!is_array($params)) {
-            return showJson($params, false);
-        }
-
-        if(!$result = MerchantService::make()->applyConfirm($this->userId, $params)){
-            return showJson(MerchantService::make()->getError(), false);
-        }else{
-            return showJson(MerchantService::make()->getError(), true, $result);
-        }
-    }
-
-    /**
-     * 冻结/解冻申请
-     * @return array
-     */
-    public function lock(MerchantValidator $validator)
-    {
-        $params = request()->all();
-        $params = $validator->check($params, 'info');
-        if (!is_array($params)) {
-            return showJson($params, false);
-        }
-
-        if(!$result = MerchantService::make()->lock($this->userId, $params)){
-            return showJson(MerchantService::make()->getError(), false);
-        }else{
-            return showJson(MerchantService::make()->getError(), true, $result);
-        }
-    }
 
     /**
      * 修改账号信息

+ 1 - 1
app/Models/MerchantModel.php

@@ -43,6 +43,6 @@ class MerchantModel extends BaseModel
     {
         return $this->hasOne(MemberModel::class, 'id','user_id')
             ->where(['mark'=>1])
-            ->select(['id','nickname','parent_id','balance','trc_url','usdt','avatar','status']);
+            ->select(['id','nickname','parent_id','balance','trc_url','usdt','pay_password','avatar','status']);
     }
 }

+ 120 - 0
app/Services/Api/MerchantCategoryService.php

@@ -0,0 +1,120 @@
+<?php
+// +----------------------------------------------------------------------
+// | LARAVEL8.0 框架 [ LARAVEL ][ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 LARAVEL研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.laravel.cn
+// +----------------------------------------------------------------------
+// | Author: laravel开发员 <laravel.qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Services\Api;
+use App\Models\MerchantCategoryModel;
+use App\Services\BaseService;
+use App\Services\RedisService;
+
+/**
+ * 商户分类服务管理-服务类
+ * @author laravel开发员
+ * @since 2020/11/11
+ * Class MerchantCategoryService
+ * @package App\Services\Api
+ */
+class MerchantCategoryService extends BaseService
+{
+    // 静态对象
+    protected static $instance = null;
+
+    /**
+     * 构造函数
+     * @author laravel开发员
+     * @since 2020/11/11
+     * MerchantCategoryService constructor.
+     */
+    public function __construct()
+    {
+        $this->model = new MerchantCategoryModel();
+    }
+
+    /**
+     * 静态入口
+     * @return static|null
+     */
+    public static function make()
+    {
+        if (!self::$instance) {
+            self::$instance = (new static());
+        }
+        return self::$instance;
+    }
+
+    /**
+     * 按排序获取缓存列表
+     * @param $position
+     * @param int $num
+     * @return array|mixed
+     */
+    public function getMenuList($num=8)
+    {
+        $cacheKey = "caches:merchantCategory:{$num}";
+        $datas = RedisService::get($cacheKey);
+        if($datas){
+            return $datas;
+        }
+        $datas = $this->model->where(['is_menu'=> 1,'status'=> 1,'mark'=>1])
+            ->select(['id','icon','name','pages','sort'])
+            ->limit($num)
+            ->orderBy('sort','asc')
+            ->orderBy('id','desc')
+            ->get()
+            ->each(function($item, $k){
+                $item['icon'] = $item['icon']? get_image_url($item['icon']) : '';
+            });
+        $datas = $datas? $datas->toArray() : [];
+        if($datas){
+            RedisService::set($cacheKey, $datas, 3 * 86400);
+        }
+
+        return $datas;
+    }
+
+    /**
+     * 分类列表
+     * @param $showType
+     * @param int $num
+     * @return array|mixed
+     */
+    public function getOptions($showType=0,$num=99)
+    {
+        $cacheKey = "caches:merchantCategory:option_{$showType}_{$num}";
+        $datas = RedisService::get($cacheKey);
+        if($datas){
+            return $datas;
+        }
+        $datas = $this->model->where(['is_menu'=> 1,'status'=> 1,'mark'=>1])
+            ->where(function($query) use($showType){
+                if($showType == 1){
+                    $query->whereNotIn('type',[3]);
+                }
+            })
+            ->select(['id','name','icon'])
+            ->limit($num)
+            ->orderBy('sort','asc')
+            ->orderBy('id','desc')
+            ->get();
+        $datas = $datas? $datas->toArray() : [];
+        if($datas){
+            foreach($datas as &$item){
+                if(isset($item['icon'])){
+                    $item['icon'] = $item['icon']? get_image_url($item['icon']) : '';
+                }
+                unset($item);
+            }
+            RedisService::set($cacheKey, $datas, rand(30, 60));
+        }
+
+        return $datas;
+    }
+
+}

+ 43 - 392
app/Services/Api/MerchantService.php

@@ -282,12 +282,6 @@ class MerchantService extends BaseService
             return false;
         }
 
-        // 验证是否是技师
-        if(MechanicModel::where(['user_id'=> $userId,'status'=>2,'mark'=>1])->value('id')) {
-            $this->error = 2687;
-            return false;
-        }
-
         // 验证账户是否正常
         $userInfo = MemberService::make()->getCacheInfo(['id'=>$userId], ['id','status']);
         $status = isset($userInfo['status'])? $userInfo['status'] : 0;
@@ -428,12 +422,6 @@ class MerchantService extends BaseService
             return false;
         }
 
-        // 验证是否是技师
-        if(MechanicModel::where(['user_id'=> $userId,'status'=>2,'mark'=>1])->value('id')) {
-            $this->error = 2687;
-            return false;
-        }
-
         // 验证账户是否正常
         $userInfo = MemberService::make()->getCacheInfo(['id'=>$userId], ['id','status']);
         $status = isset($userInfo['status'])? $userInfo['status'] : 0;
@@ -442,21 +430,15 @@ class MerchantService extends BaseService
             return false;
         }
 
-        $type = isset($params['type'])? intval($params['type']) : 0;
+        $type = isset($params['type'])? intval($params['type']) : 1;
         $category = isset($params['category'])? intval($params['category']) : 0;
-        $lng = isset($params['lng'])? floatval($params['lng']) : 0;
-        $lat = isset($params['lat'])? floatval($params['lat']) : 0;
+        $currency = isset($params['currency'])? trim($params['currency']) : '';
+        $country = isset($params['country'])? trim($params['country']) : '';
+        $city = isset($params['city'])? trim($params['city']) : '';
         $address = isset($params['address'])? trim($params['address']) : '';
         $albums = isset($params['albums'])? get_format_images($params['albums']) : '';
-        $file1 = isset($params['file1'])? get_format_images($params['file1']) : '';
-        $file2 = isset($params['file2'])? get_format_images($params['file2']) : '';
-        $file3 = isset($params['file3'])? get_format_images($params['file3']) : '';
-        $alipayQrcodeData = isset($params['alipay_qrcode'])? $params['alipay_qrcode'] : [];
-        $alipayQrcode = isset($alipayQrcodeData[0]['url'])? get_image_path($alipayQrcodeData[0]['url']) : '';
-        $wxpayQrcodeData = isset($params['wxpay_qrcode'])? $params['wxpay_qrcode'] : [];
-        $wxpayQrcode = isset($wxpayQrcodeData[0]['url'])? get_image_path($wxpayQrcodeData[0]['url']) : '';
-        $logoData = isset($params['logo'])? $params['logo'] : [];
-        $logo = isset($logoData[0]['url'])? get_image_path($logoData[0]['url']) : '';
+        $businessImg = isset($params['business_img'])? get_image_path($params['business_img']) : '';
+        $logo = isset($params['logo'])? get_image_path($params['logo']) : '';
         $name = isset($params['name'])? $params['name'] : '';
 
         // 验证分类
@@ -471,31 +453,27 @@ class MerchantService extends BaseService
             return false;
         }
 
-        // 位置信息
-        if($type == 1 && (empty($lat) || empty($lng) || empty($address))){
-            $this->error = 2210;
-            //return false;
-        }
-
-        // 证书
-        if(empty($file1)){
-            $this->error = $type == 1? 2206 : 2211;
+        $mobile = isset($params['mobile'])? trim($params['mobile']) : '';
+        $telegram = isset($params['telegram'])? trim($params['telegram']) : '';
+        if(empty($mobile) && empty($telegram)){
+            $this->error = 2204;
             return false;
         }
 
-        if(empty($file2)){
-            $this->error = 2207;
+        // 地址信息
+        if(empty($country) || empty($city) || empty($address)){
+            $this->error = 2210;
             return false;
         }
 
-        if(empty($file3)){
-            $this->error = $type==1? 2208 : 2209;
+        if(empty($currency)){
+            $this->error = 2204;
             return false;
         }
 
-        // 收款码
-        if(empty($alipayQrcode) || empty($wxpayQrcode)){
-            $this->error = 2205;
+        // 营业执照
+        if(empty($businessImg)){
+            $this->error = 2211;
             return false;
         }
 
@@ -507,20 +485,14 @@ class MerchantService extends BaseService
             'type'=> $type,
             'logo'=> $logo,
             'albums'=> $albums? $albums : '',
-            'qualification_imgs'=> $file1? $file1 : '',
-            'other_certificates'=> $file2? $file2 : '',
-            'idcard_imgs'=> $file3? $file3 : '',
-            'alipay_qrcode'=> $alipayQrcode? $alipayQrcode : '',
-            'wxpay_qrcode'=> $wxpayQrcode? $wxpayQrcode : '',
-            'lng'=> $lng,
-            'lat'=> $lat,
+            'business_img'=> $businessImg? $businessImg : '',
+            'currency'=> $currency,
+            'country'=> $country,
+            'city'=> $city,
             'address'=> $address,
-            'province'=> isset($params['province'])? trim($params['province']) : '',
-            'city'=> isset($params['city'])? trim($params['city']) : '',
-            'district'=> isset($params['district'])? trim($params['district']) : '',
-            'intro'=> isset($params['intro'])? trim($params['intro']) : '',
-            'mobile'=> isset($params['mobile'])? trim($params['mobile']) : '',
-            'business_scope'=> isset($params['business_scope'])? trim($params['business_scope']) : '',
+            'description'=> isset($params['description'])? trim($params['description']) : '',
+            'mobile'=> $mobile,
+            'telegram'=> $telegram,
             'service_time'=> isset($params['service_time'])? trim($params['service_time']) : '',
             'create_time'=> time(),
             'update_time'=> time(),
@@ -558,27 +530,16 @@ class MerchantService extends BaseService
         $info = $this->model->with(['category'])->where(['user_id'=> $userId,'mark'=>1])
             ->orderBy('id','desc')
             ->first();
-        $info = $info? $info->setHidden(['balance','deposit','update_time','mark'])->toArray() : [];
+        $info = $info? $info->setHidden(['usdt','update_time','mark'])->toArray() : [];
         if($info){
             $info['logo'] = isset($info['logo']) && $info['logo']? [['url'=> get_image_url($info['logo'])]] : [];
-            $info['alipay_qrcode'] = isset($info['alipay_qrcode']) && $info['alipay_qrcode']? [['url'=> get_image_url($info['alipay_qrcode'])]] : [];
-            $info['wxpay_qrcode'] = isset($info['wxpay_qrcode']) && $info['wxpay_qrcode']? [['url'=> get_image_url($info['wxpay_qrcode'])]] : [];
-            $file1 = isset($info['qualification_imgs']) && $info['qualification_imgs']? json_decode($info['qualification_imgs'], true) : [];
-            $info['file1'] = $file1? get_images_preview($file1) : [];
-            $file2 = isset($info['other_certificates']) && $info['other_certificates']? json_decode($info['other_certificates'], true) : [];
-            $info['file2'] = $file2? get_images_preview($file2) : [];
-            $file3 = isset($info['idcard_imgs']) && $info['idcard_imgs']? json_decode($info['idcard_imgs'], true) : [];
-            $info['file3'] = $file3? get_images_preview($file3) : [];
+            $info['business_img'] = isset($info['business_img']) && $info['business_img']? [['url'=> get_image_url($info['business_img'])]] : [];
             $albums = isset($info['albums']) && $info['albums']? json_decode($info['albums'], true) : [];
             $info['albums'] = $albums? get_images_preview($albums) : [];
             if(isset($info['category']) && $info['category']){
                 $info['category_name'] = isset($info['category']['name'])? $info['category']['name'] : '';
                 $info['category'] = isset($info['category']['id'])? $info['category']['id'] : '';
             }
-
-            unset($info['qualification_imgs']);
-            unset($info['other_certificates']);
-            unset($info['idcard_imgs']);
         }
 
         return $info;
@@ -589,109 +550,13 @@ class MerchantService extends BaseService
      * @param $params
      * @return bool
      */
-    public function applyConfirm($userId, $params)
-    {
-        $id = isset($params['id'])? $params['id'] : 0;
-        $info = $this->model->where(['id'=> $id,'mark'=>1])->select('id','user_id','name','status','mark')->first();
-        $status = isset($info['status'])? $info['status'] : 0;
-        if(empty($info) || $id<=0){
-            $this->error = 2230;
-            return false;
-        }
-
-        if($status != 1){
-            $this->error = 2231;
-            return false;
-        }
-
-        $status = isset($params['status'])? intval($params['status']) : 0;
-        $auditRemark = isset($params['audit_remark'])? trim($params['audit_remark']) : '';
-        if(!in_array($status,[2,3])){
-            $this->error = 2232;
-            return false;
-        }
-
-        if($this->model->where(['id'=> $id])->update(['status'=> $status,'audit_remark'=>$auditRemark,'update_time'=>time()])){
-            $this->error = 1040;
-            return true;
-        }else{
-            $this->error = 1041;
-            return false;
-        }
-    }
-
-    /**
-     * @param $userId
-     * @param $params
-     * @return bool
-     */
-    public function lock($userId, $params)
-    {
-        $id = isset($params['id'])? $params['id'] : 0;
-        $info = $this->model->where(['id'=> $id,'mark'=>1])->select('id','user_id','name','status','mark')->first();
-        $status = isset($info['status'])? $info['status'] : 0;
-        if(empty($info) || $id<=0){
-            $this->error = 2230;
-            return false;
-        }
-
-        if($status <= 1){
-            $this->error = 2234;
-            return false;
-        }
-
-        $agentInfo = AgentModel::where(['user_id'=> $userId,'mark'=>1])->select(['id','user_id','realname'])->first();
-        $agentId = isset($agentInfo['id'])? $agentInfo['id'] : 0;
-        if(empty($agentInfo)){
-            $this->error = 2024;
-            return false;
-        }
-
-        $status = isset($params['status'])? intval($params['status']) : 0;
-        $remark = isset($params['remark'])? trim($params['remark']) : '';
-        if(!in_array($status,[2,3])){
-            $this->error = 2232;
-            return false;
-        }
-
-        if($this->model->where(['id'=> $id])->update(['agent_lock'=>1,'agent_lock_id'=> $agentId,'agent_lock_status'=> $status,'agent_lock_remark'=>$remark,'update_time'=>time()])){
-            $this->error = 1035;
-            return true;
-        }else{
-            $this->error = 1036;
-            return false;
-        }
-    }
-
-    /**
-     * 删除
-     * @return array|false
-     */
-    public function delete()
-    {
-        // 参数
-        $id = request()->post('id');
-        if (empty($id)) {
-            $this->error = 2014;
-            return false;
-        }
-
-        $this->error = 1002;
-        $this->model->where(['id'=> $id,'mark'=>0])->where('update_time','<=', time() - 3*86400)->delete();
-        return $this->model->where(['id'=> $id])->update(['mark'=> 0, 'update_time'=> time()]);
-    }
-
-    /**
-     * @param $userId
-     * @param $params
-     * @return bool
-     */
     public function modify($userId, $params)
     {
         // 用户验证
-        $info = $this->model->where(['user_id' => $userId, 'mark' => 1])
+        $info = $this->model->with(['member'])->where(['user_id' => $userId, 'mark' => 1])
             ->select(['id','user_id', 'status'])
             ->first();
+        $userInfo = isset($info['member'])? $info['member'] : [];
         if (!$info) {
             $this->error = 2001;
             return false;
@@ -707,56 +572,31 @@ class MerchantService extends BaseService
         $data = ['update_time' => time()];
         $payPassword = isset($params['pay_password']) ? $params['pay_password'] : '';
 
-        // 手机号验证
-        $oldMobile = isset($params['old_mobile']) ? $params['old_mobile'] : '';
-        if (isset($params['old_mobile']) && $oldMobile) {
-            // 短信验证码
-            $code = isset($params['old_code']) ? $params['old_code'] : '';
-            if (empty($code)) {
-                $this->error = 2013;
-                return false;
-            }
+        // 验证账户是否正常
+        $userInfo = MemberService::make()->getCacheInfo(['id'=>$userId], ['id','status']);
+        $status = isset($userInfo['status'])? $userInfo['status'] : 0;
+        if(empty($userInfo) || $status != 1){
+            $this->error = 2017;
+            return false;
+        }
+
+
+        if($userPayPassword != get_password($payPassword)){
 
-            if (!SmsService::make()->check($oldMobile, $code, 'modify')) {
-                $this->error = 1044;
-                return false;
-            }
         }
 
         // 手机号验证
         $mobile = isset($params['mobile']) ? $params['mobile'] : '';
         if (isset($params['mobile']) && $mobile) {
             $data['mobile'] = $mobile;
-            $checkInfo = $this->model->where(['mobile' => $mobile, 'mark' => 1])->select(['id','user_id', 'status'])->first();
-            if ($checkInfo && $checkInfo['user_id'] != $userId) {
-//                $this->error = 2009;
-//                return false;
-            }
-
-            // 短信验证码
-            $code = isset($params['sms_code']) ? $params['sms_code'] : '';
-            if (empty($code)) {
-                $this->error = 2013;
-                return false;
-            }
-
-            if (!SmsService::make()->check($mobile, $code, 'modify')) {
-                $this->error = SmsService::make()->getError();
-                return false;
-            }
-        }
-
-        if(isset($params['settle_type']) && in_array($params['settle_type'],[0,1,2,3])){
-            $data['settle_type'] = intval($params['settle_type']);
         }
 
-        if(isset($params['trade_status']) && in_array($params['trade_status'],[1,2])){
-            $data['trade_status'] = intval($params['trade_status']);
+        if(isset($params['name']) && $params['name']){
+            $data['name'] = trim($params['name']);
         }
 
-        if (isset($params['pay_password']) && $payPassword) {
-            $payPassword = get_password($payPassword);
-            $data['pay_password'] = $payPassword;
+        if(isset($params['service_time']) && $params['service_time']){
+            $data['service_time'] = trim($params['service_time']);
         }
 
         // 修改数据
@@ -766,193 +606,4 @@ class MerchantService extends BaseService
         $this->error = 1008;
         return true;
     }
-
-    /**
-     * 缴纳保证金
-     * @param $userId 商家用户
-     * @param $params
-     * @return array|false
-     */
-    public function deposit($userId, $params)
-    {
-        $merchId = isset($params['id'])? $params['id'] : 0;
-        $money = isset($params['money'])? $params['money'] : 0;
-        $payType = isset($params['pay_type']) && $params['pay_type']? intval($params['pay_type']) : 10;
-        if($money<=0){
-            $this->error = 2031;
-            return false;
-        }
-
-        if(!in_array($payType, [10,20])){
-            $this->error = 2032;
-            return false;
-        }
-
-        $info = $this->model->where(['id'=> $merchId,'mark'=>1])
-            ->select(['id','name','mobile','balance','deposit','status'])
-            ->first();
-        $deposit = isset($info['deposit'])? $info['deposit'] : 0;
-        $status = isset($info['status'])? $info['status'] : 0;
-        if($merchId<=0 || empty($info) || $status != 2){
-            $this->error = 2015;
-            return false;
-        }
-
-        // 充值订单
-        $orderNo = get_order_num('DP');
-        $data = [
-            'source_order_no'=> $orderNo,
-            'user_id'=> $userId,
-            'merch_id'=> $merchId,
-            'type'=> 14,
-            'coin_type'=> 1,
-            'user_type'=> 2,
-            'money'=> $money,
-            'balance'=> $deposit,
-            'date'=> date('Y-m-d'),
-            'create_time'=> time(),
-            'update_time'=> time(),
-            'remark'=> $payType == 10?'微信支付商家保证金':'支付宝支付商家保证金',
-            'status'=> 2,
-            'mark'=> 1,
-        ];
-
-        if(!$orderId = AccountLogModel::insertGetId($data)){
-            $this->error = 2037;
-            return false;
-        }
-
-        // 支付方式
-        $order = [
-            'order_no'=> $orderNo,
-            'type'=> 0,
-            'pay_type'=> $payType,
-            'pay_money'=> $money,
-            'body'=> '缴纳保证金订单支付',
-        ];
-
-        switch($payType){
-            case 20: // 支付宝
-                $payment = PaymentService::make()->aliPay($info, $order,'deposit');
-                if(empty($payment)){
-                    DB::rollBack();
-                    $this->error = PaymentService::make()->getError();
-                    return false;
-                }
-                break;
-            case 10: // 微信支付
-                $payment = PaymentService::make()->wechatPay($info, $order,'deposit');
-                if(empty($payment)){
-                    DB::rollBack();
-                    $this->error = PaymentService::make()->getError();
-                    return false;
-                }
-                break;
-            default:
-                $this->error = 1030;
-                return false;
-        }
-
-        $this->error = 2038;
-        return [
-            'id'=> $orderId,
-            'payment'=> $payment,
-            'total'=> $money,
-            'order_no'=> $orderNo,
-            'pay_type'=> $payType,
-        ];
-    }
-
-    /**
-     * 退还保证金处理
-     * @param $userId 用户
-     * @param $params
-     * @return bool
-     */
-    public function rebackDeposit($userId, $params)
-    {
-        $merchId = isset($params['id'])? $params['id'] : 0;
-        if($merchId<=0){
-            $this->error = 2039;
-            return false;
-        }
-
-        $info = $this->model->where(['id'=> $merchId,'mark'=>1])
-            ->select(['id','name','mobile','balance','deposit','status'])
-            ->first();
-        $deposit = isset($info['deposit'])? floatval($info['deposit']) : 0;
-        $balance = isset($info['balance'])? floatval($info['balance']) : 0;
-        $status = isset($info['status'])? $info['status'] : 0;
-        if($merchId<=0 || empty($info) || $status != 2){
-            $this->error = 2015;
-            return false;
-        }
-
-        if($deposit<=0){
-            $this->error = 2041;
-            return false;
-        }
-
-        // 时间限制
-        $depositTime = ConfigService::make()->getConfigByCode('shop_deposit_time');
-        $depositTime = $depositTime>=0? $depositTime : 0;
-        $paymentTime = AccountLogModel::where(['merch_id'=> $merchId,'type'=>14,'coin_type'=>1,'status'=>1,'mark'=>1])->orderBy('create_time','desc')->value('create_time');
-        if($depositTime>0 && $paymentTime>0 && $paymentTime + ($depositTime*86400)> time()){
-            $this->error = lang(2040,['time'=> $depositTime]);
-            return false;
-        }
-
-        DB::beginTransaction();
-        // 余额
-        $updateData = ['balance' => DB::raw("balance + {$deposit}"),'deposit'=>0.00, 'update_time' => time()];
-        if(!$this->model->where(['id'=> $merchId])->update($updateData)){
-            DB::rollBack();
-            $this->error = 2042;
-            return false;
-        }
-
-        // 退还记录
-        $data = [
-            'source_order_no'=> '',
-            'user_id'=> $userId,
-            'merch_id'=> $merchId,
-            'type'=> 14,
-            'coin_type'=> 4,
-            'user_type'=> 2,
-            'money'=> -$deposit,
-            'balance'=> $balance,
-            'date'=> date('Y-m-d'),
-            'create_time'=> time(),
-            'update_time'=> time(),
-            'remark'=> '商家保证金退还',
-            'status'=> 1,
-            'mark'=> 1,
-        ];
-
-        if(!$id = AccountLogModel::insertGetId($data)){
-            DB::rollBack();
-            $this->error = 2042;
-            return false;
-        }
-
-        DB::commit();
-
-        $params = [
-            'title' => '商家保证金退还到账通知',
-            'body' => "您的商家保证金申请退还已成功,请点击查看详情",
-            'type' => 3, // 1-公告通知,2-订单通知,3-交易通知,4-其他
-            'content' => [
-                'pay_time' => ['name' => '退还时间', 'text' => date('Y-m-d H:i:s')],
-                'money' => ['name' => '金额', 'text' => $deposit],
-                'balance' => ['name' => '当前余额', 'text' => moneyFormat($balance + $deposit,2)],
-                'status' => ['name' => '状态', 'text' => '已到账'],
-            ],
-            'click_type' => 'payload',
-            'url' => '/pages/account/index?type=3',
-        ];
-
-        PushService::make()->pushMessageByUser($userId, $params, 0);
-        $this->error = 2043;
-        return true;
-    }
 }

+ 9 - 0
routes/api.php

@@ -133,6 +133,15 @@ Route::prefix('v1')->group(function(){
     Route::match(['get','post'],'/acceptor/index', [\App\Http\Controllers\Api\v1\AcceptorController::class, 'index']);
     Route::match(['get','post'],'/acceptor/info', [\App\Http\Controllers\Api\v1\AcceptorController::class, 'info']);
 
+    // 商家
+    Route::get('/merchant/category', [\App\Http\Controllers\Api\v1\MerchantController::class, 'category']);
+    Route::post('/merchant/apply', [\App\Http\Controllers\Api\v1\MerchantController::class, 'apply']);
+    Route::post('/merchant/applyInfo', [\App\Http\Controllers\Api\v1\MerchantController::class, 'applyInfo']);
+    Route::post('/merchant/info', [\App\Http\Controllers\Api\v1\MerchantController::class, 'info']);
+    Route::post('/merchant/modify', [\App\Http\Controllers\Api\v1\MerchantController::class, 'modify']);
+    Route::post('/merchant/index', [\App\Http\Controllers\Api\v1\MerchantController::class, 'index']);
+
+
     // 承兑商交易
     Route::match(['get','post'],'/trade/sell', [\App\Http\Controllers\Api\v1\TradeController::class, 'sell']);
     Route::match(['get','post'],'/trade/pay', [\App\Http\Controllers\Api\v1\TradeController::class, 'pay']);