zhangxiaobin 1 год назад
Родитель
Сommit
bdcacd23f5

+ 10 - 0
application/api/controller/Companys.php

@@ -218,6 +218,16 @@ class Companys extends Api
                 $data['user_id'] = $userId;
                 $data['createtime'] = $time;
                 $res = $this->model->insertGetId($data);
+                if ($res) {//生成门店钱包
+                    $companyAddData = [
+                        'user_id' => $res,
+                        'money' => 0.00,
+                    ];
+                    $companyRes = Db::name('company_wallet')->insertGetId($companyAddData);
+                    if (!$companyRes) {
+                        throw new Exception('入驻提交失败');
+                    }
+                }
             } else {
                 $data['updatetime'] = $time;
                 $where['id'] = $id;

+ 6 - 4
application/api/controller/User.php

@@ -93,10 +93,12 @@ class User extends Api
                 if (!empty($user['mobile']) && $user['mobile'] != $mobile) {
                     $this->error('请用初始手机号登录');
                 } else {
-                    $user->mobile = $mobile;
-                    $userRes = $user->save();
-                    if (!$userRes) {
-                        $this->error('绑定失败');
+                    if (empty($user['mobile'])) {
+                        $user->mobile = $mobile;
+                        $userRes = $user->save();
+                        if (!$userRes) {
+                            $this->error('绑定失败');
+                        }
                     }
                 }
             }

+ 1 - 1
application/common/service/OrderService.php

@@ -203,7 +203,7 @@ class OrderService
                 'server_info'     => isset($package['info']) ? $package['info'] : '',//套餐内容
                 'server_images'   => isset($package['images']) ? $package['images'] : '',//套餐图片
                 'pay_fee'         => isset($package['price']) ? $package['price'] : 0.00,//套餐价格
-                'status'          => 2,//状态:1=待支付,2=待处理,3=已完成,4=已取消
+                'status'          => 1,//状态:1=待核销,2=待处理,3=已完成,4=已取消
                 'pay_time'        => $time,
                 'paytype'         => $orderPayType,//支付方式:1=线下,2=余额,3=微信
                 'total_fee'       => isset($package['price']) ? $package['price'] : 0.00,//支付总额