Parcourir la source

Merge branch 'master' of http://git.huxiukeji.com/lizhen/lanjingling

lizhen_gitee il y a 1 an
Parent
commit
0a4050a550

+ 11 - 11
application/admin/view/user/user/edit.html

@@ -1,12 +1,12 @@
 <form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
     {:token()}
     <input type="hidden" name="row[id]" value="{$row.id}">
-    <div class="form-group">
+    <!--<div class="form-group">
         <label for="c-group_id" class="control-label col-xs-12 col-sm-2">{:__('Group')}:</label>
         <div class="col-xs-12 col-sm-4">
             {$groupList}
         </div>
-    </div>
+    </div>-->
     <div class="form-group">
         <label for="c-username" class="control-label col-xs-12 col-sm-2">{:__('Username')}:</label>
         <div class="col-xs-12 col-sm-4">
@@ -25,12 +25,12 @@
             <input id="c-password" data-rule="password" class="form-control" name="row[password]" type="password" value="" placeholder="{:__('Leave password blank if dont want to change')}" autocomplete="new-password" />
         </div>
     </div>
-    <div class="form-group">
+    <!--<div class="form-group">
         <label for="c-email" class="control-label col-xs-12 col-sm-2">{:__('Email')}:</label>
         <div class="col-xs-12 col-sm-4">
             <input id="c-email" data-rule="" class="form-control" name="row[email]" type="text" value="{$row.email|htmlentities}">
         </div>
-    </div>
+    </div>-->
     <div class="form-group">
         <label for="c-mobile" class="control-label col-xs-12 col-sm-2">{:__('Mobile')}:</label>
         <div class="col-xs-12 col-sm-4">
@@ -51,7 +51,7 @@
             <ul class="row list-inline faupload-preview" id="p-avatar"></ul>
         </div>
     </div>
-    <div class="form-group">
+    <!--<div class="form-group">
         <label for="c-level" class="control-label col-xs-12 col-sm-2">{:__('Level')}:</label>
         <div class="col-xs-12 col-sm-4">
             <input id="c-level" data-rule="required" class="form-control" name="row[level]" type="number" value="{$row.level}">
@@ -62,26 +62,26 @@
         <div class="col-xs-12 col-sm-8">
             {:build_radios('row[gender]', ['1'=>__('Male'), '0'=>__('Female')], $row['gender'])}
         </div>
-    </div>
+    </div>-->
     <div class="form-group">
         <label for="c-birthday" class="control-label col-xs-12 col-sm-2">{:__('Birthday')}:</label>
         <div class="col-xs-12 col-sm-4">
             <input id="c-birthday" data-rule="" class="form-control datetimepicker" data-date-format="YYYY-MM-DD" data-use-current="true" name="row[birthday]" type="text" value="{$row.birthday}">
         </div>
     </div>
-    <div class="form-group">
+    <!--<div class="form-group">
         <label for="c-bio" class="control-label col-xs-12 col-sm-2">{:__('Bio')}:</label>
         <div class="col-xs-12 col-sm-8">
             <input id="c-bio" data-rule="" class="form-control" name="row[bio]" type="text" value="{$row.bio|htmlentities}">
         </div>
-    </div>
+    </div>-->
     <div class="form-group">
         <label for="c-money" class="control-label col-xs-12 col-sm-2">{:__('Money')}:</label>
         <div class="col-xs-12 col-sm-4">
             <input id="c-money" data-rule="required" class="form-control" name="row[money]" type="number" value="{$row.money}">
         </div>
     </div>
-    <div class="form-group">
+    <!--<div class="form-group">
         <label for="c-score" class="control-label col-xs-12 col-sm-2">{:__('Score')}:</label>
         <div class="col-xs-12 col-sm-4">
             <input id="c-score" data-rule="required" class="form-control" name="row[score]" type="number" value="{$row.score}">
@@ -128,7 +128,7 @@
         <div class="col-xs-12 col-sm-4">
             <input id="c-joinip" data-rule="required" class="form-control" name="row[joinip]" type="text" value="{$row.joinip}">
         </div>
-    </div>
+    </div>-->
     <div class="form-group">
         <label for="c-jointime" class="control-label col-xs-12 col-sm-2">{:__('Jointime')}:</label>
         <div class="col-xs-12 col-sm-4">
@@ -138,7 +138,7 @@
     <div class="form-group">
         <label for="content" class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
         <div class="col-xs-12 col-sm-8">
-            {:build_radios('row[status]', ['normal'=>__('Normal'), 'hidden'=>__('Hidden')], $row['status'])}
+            {:build_radios('row[status]', [1=>__('Normal'), 0=>__('Hidden')], $row['status'])}
         </div>
     </div>
     <div class="form-group layer-footer">

+ 11 - 10
application/api/controller/Order.php

@@ -28,7 +28,7 @@ class Order extends Api
 
             $o = 'order';
             $st = 'servicetype';
-            $field = $o.'.id,orderno,server_info,server_images,status,user_mobile,'.$o.'.user_car_number,'.
+            $field = $o.'.id,orderno,server_time,server_info,server_images,status,user_mobile,'.$o.'.user_car_number,'.
                 $o.'.createtime,cancel_time,cancel_reason,pay_fee,appen_fee,finish_time,'.$st.'.title as `service_title`,paytype';
             $where[$o.'.user_id'] = $this->auth->id;
             $where[$o.'.company_id'] = $this->auth->company_id;
@@ -41,7 +41,7 @@ class Order extends Api
             if (!empty($result)) {
                 $statusArr  = [2=>'待处理',3=>'已完成',4=>'已取消'];
                 $paytypeArr = [1=>'线下',2=>'余额',3=>'微信'];
-                $timeArr = ['createtime','cancel_time','finish_time'];
+                $timeArr = ['createtime','cancel_time','finish_time','server_time'];
                 foreach ($result as $key => &$value) {
                     foreach ($timeArr as $k => $v) {
                         $value[$v] = !empty($value[$v]) ? date('Y年m月d日 H:i:s', $value[$v]) : '';
@@ -121,7 +121,7 @@ class Order extends Api
             $st = 'servicetype';
             $where[$o.'.user_id'] = $this->auth->id;
             $where[$o.'.id'] = $id;
-            $field = $o.'.id,orderno,server_info,server_images,status,user_mobile,'.$o.'.user_car_number,'.
+            $field = $o.'.id,orderno,server_time,server_info,server_images,status,user_mobile,'.$o.'.user_car_number,'.
                 $o.'.createtime,cancel_time,cancel_reason,pay_fee,appen_fee,finish_time,'.$st.'.title as `service_title`,paytype';
             $result = $this->model->alias($o)->field($field)
                 ->join($st,$st.'.id = '.$o.'.servicetype_id','LEFT')
@@ -129,7 +129,7 @@ class Order extends Api
             if (!empty($result)) {
                 $statusArr  = [2=>'待处理',3=>'已完成',4=>'已取消'];
                 $paytypeArr = [1=>'线下',2=>'余额',3=>'微信'];
-                $timeArr = ['createtime','cancel_time','finish_time'];
+                $timeArr = ['createtime','cancel_time','finish_time','server_time'];
                 foreach ($timeArr as $k => $v) {
                     $result[$v] = !empty($result[$v]) ? date('Y年m月d日 H:i:s', $result[$v]) : '';
                 }
@@ -185,7 +185,7 @@ class Order extends Api
             $text = 'hexiaoorder_'.$id;
             $logo = '';
             $filRoute = '/uploads/temp/';
-            $saveDir = ROOT_PATH.'public/uploads/temp'.DS;
+            $saveDir = ROOT_PATH.'public'.DS.'uploads'.DS.'temp'.DS;
             $fileStr = md5('order_'.$id);
             $localpng = $saveDir.$fileStr.'.png';
             //验证存在直接返回
@@ -217,15 +217,16 @@ class Order extends Api
             if (!empty($serviceTypeId)) {
                 $where[$o.'.servicetype_id'] = $serviceTypeId;
             }
-            if (!empty($carId)) {
-                $where[$o.'.user_car_id'] = $carId;
-            }
-            if (empty($carNumber)) {
+            if (!empty($carNumber)) {
                 $where[$o.'.user_car_number'] = $carNumber;
+            } else {
+                if (!empty($carId)) {
+                    $where[$o.'.user_car_id'] = $carId;
+                }
             }
             $where[$o.'.user_id'] = $this->auth->id;
             $where[$o.'.status'] = ['in',[2,3]];//状态:2=待处理,3=已完成,4=已取消
-            $where[$st.'.baoyang_switch'] = 1;//弹出保养时间:1=是,0=否
+            $where[$st.'.is_upkeep'] = 1;//是否保养:1=是,0=否
             $field = $o.'.id,servicetype_id,server_info,finish_time,next_date,next_carlicheng,pay_fee,appen_fee,'.$st.'.title as `service_title`';
             $result = $this->model->alias($o)->field($field)
                 ->join($st,$st.'.id = '.$o.'.servicetype_id','LEFT')

+ 0 - 2
application/api/controller/Package.php

@@ -52,8 +52,6 @@ class Package extends Api
             ->field('p.*,type.title as servicetype_title')
             ->join('servicetype type','p.servicetype_id = type.id','LEFT')
             ->where('p.id',$id)->find();
-        $afterTime = time() + 86400 * $info['days'];
-        $info['days_text'] = !empty($info['days']) ? date('Y年m月d日', $afterTime) : '';
         $info = info_domain_image($info,['images','content_images']);
         $this->success(1,$info);
     }

+ 2 - 2
application/api/controller/PreOrder.php

@@ -35,7 +35,7 @@ class PreOrder extends Api
                 $where[$po.'.pre_order_status'] = $preOrderStatus;
             }
             $field = $po.'.id,name,mobile,address,remark,'.$po.'.car_id,'.$po.'.car_number,pre_time,order_time,'.$po.'.cancel_time,'.
-                $po.'.cancel_reason,'.$st.'.title,pre_order_status,'.$o.'.id as `order_id`';
+                $po.'.cancel_reason,'.$st.'.title,pre_order_status,'.$o.'.id as `order_id`,'.$o.'.server_time';
             $result = $this->model->alias($po)->field($field)
                 ->join($st,$st.'.id = '.$po.'.servicetype_id','LEFT')
                 ->join($o,$o.'.pre_order_id = '.$po.'.id','LEFT')
@@ -43,7 +43,7 @@ class PreOrder extends Api
             if (!empty($result)) {
                 $model = model('PreOrder');
                 $statusArr = $model->getPreOrderStatusList();
-                $timeArr = ['pre_time','order_time','cancel_time'];
+                $timeArr = ['pre_time','order_time','cancel_time','server_time'];
                 foreach ($result as $key => &$value) {
                     foreach ($timeArr as $k => $v) {
                         $value[$v] = !empty($value[$v]) ? date('Y年m月d日 H:i:s', $value[$v]) : '';

+ 10 - 7
application/api/controller/Recharge.php

@@ -23,24 +23,27 @@ class Recharge extends Api
         $list = Db::name('recharge_config')->field($field)->where($where)->order('id desc')->select();
 
         //追加赠送
-        /*if(!empty($list)){
+        if(!empty($list)){
             $config_ids = array_column($list,'id');
-            $gift = Db::name('recharge_gift')->alias('gift')
-                ->field('gift.*,coupons.name,coupons.info,coupons.days')
-                ->join('coupons','gift.coupon_id = coupons.id','LEFT')
-                ->where('gift.config_id','IN',$config_ids)
-                ->where('coupons.status',1)
+            $g = 'gift';
+            $c = 'coupons';
+            $gift = Db::name('recharge_gift')->alias($g)
+                ->field($g.'.config_id,'.$g.'.coupon_id,'.$g.'.number,coupons.name,coupons.info,coupons.days')
+                ->join($c,$c.'.id = '.$g.'.coupon_id' ,'LEFT')
+                ->where($g.'.config_id','IN',$config_ids)
+                ->where($c.'.status',1)
                 ->select();
 
             foreach($list as $key => &$val){
                 $val['gift'] = [];
                 foreach($gift as $k => $v){
                     if($val['id'] == $v['config_id']){
+                        unset($v['config_id']);
                         $val['gift'][] = $v;
                     }
                 }
             }
-        }*/
+        }
         $this->success(1,$list);
     }
 

+ 6 - 1
application/api/controller/Servicetype.php

@@ -24,8 +24,13 @@ class Servicetype extends Api
     public function getList()
     {
         try {
+            $isUpkeep = $this->request->param('is_upkeep',-1);
             $field = 'id,title';
-            $result = $this->model->field($field)->order('weigh asc createtime desc')->select();
+            $where = [];
+            if ($isUpkeep != -1) {
+                $where['is_upkeep'] = $isUpkeep;
+            }
+            $result = $this->model->field($field)->where($where)->order('weigh asc createtime desc')->select();
 
             $this->success('获取成功',$result);
         } catch (Exception $e) {

+ 1 - 1
application/api/controller/UserCoupons.php

@@ -79,7 +79,7 @@ class UserCoupons extends Api
             $text = 'hexiaocoupon_'.$id;
             $logo = '';
             $filRoute = '/uploads/temp/';
-            $saveDir = ROOT_PATH.'public\uploads\temp'.DS;
+            $saveDir = ROOT_PATH.'public'.DS.'uploads'.DS.'temp'.DS;
             $fileStr = md5('coupon_'.$id);
             $localpng = $saveDir.$fileStr.'.png';
             //验证存在直接返回

+ 0 - 1
application/common.php

@@ -1026,7 +1026,6 @@ if(!function_exists('build_qrcode')) {
         }
         //输出图片
         $res = imagepng($QR, $filename);
-        dump($res);
         imagedestroy($QR);
         if($res === false) {
             return $res;

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

@@ -208,7 +208,6 @@ class OrderService
                 'paytype'         => $orderPayType,//支付方式:1=线下,2=余额,3=微信
                 'total_fee'       => isset($package['price']) ? $package['price'] : 0.00,//支付总额
                 'createtime'      => $time,//下单时间
-                'updatetime'      => $time,//更新时间
                 'pay_order_id'    => $payOrderId,//支付ID
             ];
             $orderRes = Db::name('order')->insertGetId($orderData);

+ 8 - 8
public/assets/js/backend/user/user.js

@@ -25,21 +25,21 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                     [
                         {checkbox: true},
                         {field: 'id', title: __('Id'), sortable: true},
-                        {field: 'group.name', title: __('Group')},
+                        //{field: 'group.name', title: __('Group')},
                         {field: 'username', title: __('Username'), operate: 'LIKE'},
                         {field: 'nickname', title: __('Nickname'), operate: 'LIKE'},
-                        {field: 'email', title: __('Email'), operate: 'LIKE'},
+                        //{field: 'email', title: __('Email'), operate: 'LIKE'},
                         {field: 'mobile', title: __('Mobile'), operate: 'LIKE'},
                         {field: 'avatar', title: __('Avatar'), events: Table.api.events.image, formatter: Table.api.formatter.image, operate: false},
-                        {field: 'level', title: __('Level'), operate: 'BETWEEN', sortable: true},
-                        {field: 'gender', title: __('Gender'), visible: false, searchList: {1: __('Male'), 0: __('Female')}},
-                        {field: 'score', title: __('Score'), operate: 'BETWEEN', sortable: true},
-                        {field: 'successions', title: __('Successions'), visible: false, operate: 'BETWEEN', sortable: true},
+                        //{field: 'level', title: __('Level'), operate: 'BETWEEN', sortable: true},
+                        //{field: 'gender', title: __('Gender'), visible: false, searchList: {1: __('Male'), 0: __('Female')}},
+                        //{field: 'score', title: __('Score'), operate: 'BETWEEN', sortable: true},
+                        /*{field: 'successions', title: __('Successions'), visible: false, operate: 'BETWEEN', sortable: true},
                         {field: 'maxsuccessions', title: __('Maxsuccessions'), visible: false, operate: 'BETWEEN', sortable: true},
                         {field: 'logintime', title: __('Logintime'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true},
-                        {field: 'loginip', title: __('Loginip'), formatter: Table.api.formatter.search},
+                        {field: 'loginip', title: __('Loginip'), formatter: Table.api.formatter.search},*/
                         {field: 'jointime', title: __('Jointime'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true},
-                        {field: 'joinip', title: __('Joinip'), formatter: Table.api.formatter.search},
+                        //{field: 'joinip', title: __('Joinip'), formatter: Table.api.formatter.search},
                         {field: 'status', title: __('Status'), formatter: Table.api.formatter.status, searchList: {1: __('Normal'), 0: __('Hidden')}},
                         {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
                     ]