hrjy 3 éve
szülő
commit
c71b57dbd5

+ 38 - 8
.idea/workspace.xml

@@ -5,9 +5,20 @@
   </component>
   <component name="ChangeListManager">
     <list default="true" id="9df7b838-09db-466a-bed4-3e1ac8c3624d" name="变更" comment="commit">
+      <change afterPath="$PROJECT_DIR$/app/admin/controller/auction/AuctionDeliver.php" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/app/admin/model/auction/AuctionDeliver.php" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/app/admin/view/auction/auction_deliver/index.php" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/app/admin/view/auction/auction_deliver/order_goods.php" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/app/admin/controller/auction/Auction.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/admin/controller/auction/Auction.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/app/admin/model/auction/AuctionProduct.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/admin/model/auction/AuctionProduct.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/app/admin/view/auction/auction/index.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/admin/view/auction/auction/index.php" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/app/api/controller/auction/AuctionController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/api/controller/auction/AuctionController.php" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/app/api/controller/user/UserController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/api/controller/user/UserController.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/app/api/controller/auction/AuctionProductController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/api/controller/auction/AuctionProductController.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/app/models/auction/AuctionProduct.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/models/auction/AuctionProduct.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/route/api/route.php" beforeDir="false" afterPath="$PROJECT_DIR$/route/api/route.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/runtime/admin/temp/5435f22dcc53d6dd211a71551ce9d1c0.php" beforeDir="false" afterPath="$PROJECT_DIR$/runtime/admin/temp/5435f22dcc53d6dd211a71551ce9d1c0.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/runtime/cache/a9/939d920c0fa6b4fe0b897fb019672a.php" beforeDir="false" afterPath="$PROJECT_DIR$/runtime/cache/a9/939d920c0fa6b4fe0b897fb019672a.php" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -21,6 +32,14 @@
   <component name="Git.Settings">
     <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
   </component>
+  <component name="GitSEFilterConfiguration">
+    <file-type-list>
+      <filtered-out-file-type name="LOCAL_BRANCH" />
+      <filtered-out-file-type name="REMOTE_BRANCH" />
+      <filtered-out-file-type name="TAG" />
+      <filtered-out-file-type name="COMMIT_BY_MESSAGE" />
+    </file-type-list>
+  </component>
   <component name="MarkdownSettingsMigration">
     <option name="stateVersion" value="1" />
   </component>
@@ -97,7 +116,7 @@
     <property name="WebServerToolWindowPanel.toolwindow.show.date" value="false" />
     <property name="WebServerToolWindowPanel.toolwindow.show.permissions" value="false" />
     <property name="WebServerToolWindowPanel.toolwindow.show.size" value="false" />
-    <property name="last_opened_file_path" value="$PROJECT_DIR$/public/static/img" />
+    <property name="last_opened_file_path" value="$PROJECT_DIR$/app/admin/view/auction/auction_deliver" />
     <property name="node.js.detected.package.eslint" value="true" />
     <property name="node.js.detected.package.tslint" value="true" />
     <property name="node.js.selected.package.eslint" value="(autodetect)" />
@@ -108,11 +127,11 @@
   </component>
   <component name="RecentsManager">
     <key name="CopyFile.RECENT_KEYS">
+      <recent name="D:\phpstudy_pro\WWW\newQudou\app\admin\view\auction\auction_deliver" />
+      <recent name="D:\phpstudy_pro\WWW\newQudou\app\admin\view\auction" />
+      <recent name="D:\phpstudy_pro\WWW\newQudou\app\admin\controller\auction" />
+      <recent name="D:\phpstudy_pro\WWW\newQudou\app\admin\model\auction" />
       <recent name="D:\phpstudy_pro\WWW\newQudou\public\static\img" />
-      <recent name="D:\phpstudy_pro\WWW\newQudou\public\static" />
-      <recent name="D:\phpstudy_pro\WWW\newQudou\app\admin\view\system" />
-      <recent name="D:\phpstudy_pro\WWW\newQudou\app\admin\controller\system" />
-      <recent name="D:\phpstudy_pro\WWW\newQudou\app" />
     </key>
   </component>
   <component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="应用程序级" UseSingleDictionary="true" transferred="true" />
@@ -163,7 +182,11 @@
       <workItem from="1659573059465" duration="1179000" />
       <workItem from="1659659810037" duration="2396000" />
       <workItem from="1659918556904" duration="7352000" />
-      <workItem from="1660006423251" duration="3557000" />
+      <workItem from="1660006423251" duration="8052000" />
+      <workItem from="1660091699805" duration="12165000" />
+      <workItem from="1660269078348" duration="6751000" />
+      <workItem from="1660352180381" duration="1200000" />
+      <workItem from="1660523786913" duration="457000" />
     </task>
     <task id="LOCAL-00001" summary="commit">
       <created>1655962607195</created>
@@ -270,7 +293,14 @@
       <option name="project" value="LOCAL" />
       <updated>1658798088364</updated>
     </task>
-    <option name="localTasksCounter" value="16" />
+    <task id="LOCAL-00016" summary="commit">
+      <created>1660022565510</created>
+      <option name="number" value="00016" />
+      <option name="presentableId" value="LOCAL-00016" />
+      <option name="project" value="LOCAL" />
+      <updated>1660022565510</updated>
+    </task>
+    <option name="localTasksCounter" value="17" />
     <servers />
   </component>
   <component name="TypeScriptGeneratedFilesManager">

+ 12 - 5
app/admin/controller/auction/Auction.php

@@ -74,6 +74,7 @@ class Auction extends AuthController
         $f = [];
         $f[] = Form::input('nickname', '场次名称')->col(12);
         $f[] = Form::input('anticipate', '预约价格')->col(12);
+        $f[] = Form::input('threshold', '预约门槛')->col(12);
         $f[] = Form::frameImageOne('image', '场次主图片(305*305px)', Url::buildUrl('admin/widget.images/index', array('fodder' => 'image')))->icon('image')->width('100%')->height('500px');
         $f[] = Form::radio('status', '状态', 1)->options([['label' => '开启', 'value' => 1], ['label' => '关闭', 'value' => 0]])->col(12);
         $f[] = Form::select('auction_gu_id', '绑定场馆')->setOptions(function () {
@@ -132,7 +133,8 @@ class Auction extends AuthController
             'anticipate',
             'auction_gu_id',
             'site',
-            'goods_time'
+            'goods_time',
+            'threshold'
         ]);
         $validate = Validate::rule('nickname', 'require')->rule([
             'nickname' => 'require',
@@ -145,7 +147,8 @@ class Auction extends AuthController
             'rend_time' => 'require',
             'auction_gu_id' => 'require',
             'site' => 'require',
-            'goods_time' => 'require|integer|>:0'
+            'goods_time' => 'require|integer|>:0',
+            'threshold' => 'require'
         ]);
         $validate->message([
             'nickname.require' => '名称不能为空',
@@ -161,7 +164,7 @@ class Auction extends AuthController
             'goods_time.require' => '请输入放货时间',
             'goods_time.integer' => '放货时间为整数',
             'goods_time.gt' => '放货时间大于0',
-
+            'threshold'  => '请填写门槛'
         ]);
 
         $data['site'] = implode($data['site'], ',');
@@ -223,6 +226,7 @@ class Auction extends AuthController
         $f = [];
         $f[] = Form::input('nickname', '场次名称', $data->getData('nickname'))->col(12);
         $f[] = Form::input('anticipate', '预约价格', $data->getData('anticipate'))->col(12);
+        $f[] = Form::input('threshold', '预约门槛', $data->getData('threshold'))->col(12);
         $f[] = Form::frameImageOne('image', '场次主图片(305*305px)',Url::buildUrl('admin/widget.images/index', array('fodder' => 'image')), $data->getData('image'))->icon('image')->width('100%')->height('500px');
         $f[] = Form::radio('status', '状态',  $data->getData('status'))->options([['label' => '开启', 'value' => 1], ['label' => '关闭', 'value' => 0]])->col(12);
         if ($this->adminInfo['roles'] == 1){
@@ -288,7 +292,8 @@ class Auction extends AuthController
             'anticipate',
             'auction_gu_id',
             'site',
-            'goods_time'
+            'goods_time',
+            'threshold',
         ]);
         $validate = Validate::rule('nickname', 'require')->rule([
             'nickname' => 'require',
@@ -301,7 +306,8 @@ class Auction extends AuthController
             'rend_time' => 'require',
             'auction_gu_id' => 'require',
             'site' => 'require',
-            'goods_time' => 'require|integer|>:0'
+            'goods_time' => 'require|integer|>:0',
+            'threshold' => 'require'
 
         ]);
         $validate->message([
@@ -309,6 +315,7 @@ class Auction extends AuthController
             'image.require' => '图片不能为空',
             'status.require' => '状态不能为空',
             'anticipate.require' => '请填写预约价格',
+            'threshold.require' => '请填写预约门槛',
             'add_time.require' => '请选择认购开始时间价格',
             'end_time.require' => '请选择认购结束时间价格',
             'radd_time.require' => '请选择支付开始时间',

+ 137 - 0
app/admin/controller/auction/AuctionDeliver.php

@@ -0,0 +1,137 @@
+<?php
+namespace app\admin\controller\auction;
+
+use app\admin\controller\AuthController;
+use app\admin\controller\Union;
+use app\admin\model\user\User;
+use app\admin\model\user\UserBill;
+use crmeb\services\{ExpressService,
+    JsonService,
+    MiniProgramService,
+    upload\Upload,
+    WechatService,
+    FormBuilder as Form,
+    CacheService,
+    UtilService as Util,
+    JsonService as Json};
+use app\admin\model\system\{Express, SystemAttachment as SystemAttachmentModel, SystemAttachmentCategory as Category};
+use app\admin\model\auction\AuctionDeliver as model;
+use think\facade\Route as Url;
+use think\facade\Validate;
+
+/**
+ * 竞拍管理
+ * Class StoreOrder
+ * @package app\admin\controller\store
+ */
+class AuctionDeliver extends AuthController
+{
+
+    public function index()
+    {
+
+        return $this->fetch();
+    }
+
+
+    /**
+     * 获取列表
+     * @return void
+     */
+    public function list()
+    {
+        $where = Util::getMore([
+            ['page', 1],
+            ['limit', 20],
+            ['name', ''],
+            ['product', ''],
+            ['status', '']
+        ]);
+        $data = model::list($where);
+
+        return Json::successlayui($data);
+    }
+
+    public function edit($id)
+    {
+        if (!$id) Json::fail('数据不存在');
+        $data = \app\admin\model\auction\AuctionDeliver::find($id);
+        $f = [];
+        $f[] = Form::input('real_name', '用户姓名', $data->getData('real_name'))->col(12);
+        $f[] = Form::input('user_phone', '用户手机号', $data->getData('user_phone'))->col(12);
+        $f[] = Form::input('user_address', '用户收货地址', $data->getData('user_address'))->col(12);
+        $form = Form::make_post_form('修改', $f, Url::buildUrl('update', compact('id')));
+        $this->assign(compact('form'));
+        return $this->fetch('public/form-builder');
+    }
+
+    public function update()
+    {
+        $data = Util::postMore([
+            'id',
+            'real_name',
+            'user_phone',
+            'user_address',
+
+        ]);
+        $validate = Validate::rule([
+            'real_name' => 'require',
+            'user_phone' => 'require',
+            'user_address' => 'require'
+
+        ]);
+        $validate->message([
+            'real_name.require' => '收货人姓名不能为空',
+            'user_phone.require' => '收货人手机号不能为空',
+            'user_address.require' => '收货地址不能为空',
+        ]);
+        if (!$validate->check($data)) {
+            return Json::fail($validate->getError());
+        }
+        $res = \app\admin\model\auction\AuctionDeliver::update($data);
+        if ($res){
+            return Json::success('修改成功!');
+        }else{
+            return Json::fail(\app\admin\model\auction\Auction::getErrorInfo());
+        }
+    }
+
+    /*
+     * 发送货
+     * @param int $id
+     * @return html
+     * */
+    public function order_goods($id = 0)
+    {
+        $list = Express::where('is_show', 1)->order('sort desc')->column('name', 'id');
+        $this->assign([
+            'list' => $list,
+            'id' => $id
+        ]);
+        return $this->fetch();
+    }
+
+    /**
+     * TODO 送货信息提交
+     * @param Request $request
+     * @param $id
+     */
+    public function update_delivery($id = 0)
+    {
+        $data = Util::postMore([
+            ['delivery_name', ''],
+            ['delivery_id', ''],
+        ], $this->request);
+        $deliver = \app\admin\model\auction\AuctionDeliver::where('id', $id)->find();
+        if ($deliver['status'] == 2)  return Json::fail('已收货无法修改');
+        $deliver['delivery_name'] = $data['delivery_name'];
+        $deliver['delivery_id'] = $data['delivery_id'];
+        $deliver['status'] = 1;
+        $deliver['goods_time'] = time();
+        $deliver->save();
+        //短信发送
+        event('ShortMssageSend', [\app\admin\model\auction\AuctionDeliver::where('id', $id)->value('name'), 'Deliver']);
+        return Json::successful('成功!');
+    }
+
+}

+ 57 - 0
app/admin/model/auction/AuctionDeliver.php

@@ -0,0 +1,57 @@
+<?php
+
+/**
+ *
+ * @author: xaboy<365615158@qq.com>
+ * @day: 2017/11/02
+ */
+
+namespace app\admin\model\auction;
+
+use crmeb\traits\ModelTrait;
+use crmeb\basic\BaseModel;
+
+/**
+ * 场馆 Model
+ * Class WechatNews
+ * @package app\admin\model\wechat
+ */
+class AuctionDeliver extends BaseModel
+{
+
+    use ModelTrait;
+
+    protected $pk = 'id';
+
+    protected $name = 'auction_deliver';
+    protected $autoWriteTimestamp = true;
+
+
+
+    public static function list($where)
+    {
+        $model = self::alias('a')
+            ->field('a.*,b.nickname')
+            ->order('a.id DESC')
+            ->leftJoin('user b', 'a.uid = b.uid');
+        if ($where['status'] > 0)  $model = $model->where('a.status', $where['status'] -1);
+        if ($where['name'])  $model = $model->where('b.nickname|b.uid', '=', $where['name']);
+        if ($where['product'])  $model = $model->where('a.product', $where['name']);
+
+
+        if ($where['page'] && $where['limit']){
+            $model->page($where['page'], $where['limit']);
+        }else{
+            $model->page(20, 1);
+        }
+        $data['count'] = $model->count();
+        $list = $model->select()->toArray();
+        $data['data'] = $list;
+        return $data;
+
+    }
+
+
+
+
+}

+ 3 - 1
app/admin/model/auction/AuctionProduct.php

@@ -11,6 +11,7 @@ namespace app\admin\model\auction;
 use app\models\auction\AuctionTime;
 use crmeb\traits\ModelTrait;
 use crmeb\basic\BaseModel;
+use think\model\concern\SoftDelete;
 
 /**
  * 竞拍上坪 Model
@@ -21,11 +22,12 @@ class AuctionProduct extends BaseModel
 {
 
     use ModelTrait;
-
+    use SoftDelete;
     protected $pk = 'id';
 
     protected $name = 'auction_product';
     protected $autoWriteTimestamp = true;
+    protected $deleteTime = 'delete_time';
 
 
     public static function list($where, $id = 0)

+ 1 - 0
app/admin/view/auction/auction/index.php

@@ -121,6 +121,7 @@
             {field: 'nickname', title: '竞拍场', templet: '#nickname', align: 'center'},
             {field: 'name', title: '所属场馆', templet: '#name',  align: 'center'},
             {field: 'anticipate', title: '预约价格', templet: '#anticipate',  align: 'center',style : 'color: #DC143C;'},
+            {field: 'threshold', title: '预约门槛', templet: '#threshold',  align: 'center',style : 'color: #DC143C;'},
             {field: 'image', title: '封面', templet: '#image', align: 'center', width: '5%'},
             {field: 'status', title: '状态', templet: '#status', align: 'center'},
             {field: 'goods_time', title: '自动放货(分钟)', templet: '#goods_time', align: 'center'},

+ 208 - 0
app/admin/view/auction/auction_deliver/index.php

@@ -0,0 +1,208 @@
+{extend name="public/container"}
+{block name="head_top"}
+
+{/block}
+{block name="content"}
+<style>
+    .btn-outline{
+        border:none;
+    }
+    .btn-outline:hover{
+        background-color: #0e9aef;
+        color: #fff;
+    }
+    .layui-form-item .layui-btn {
+        margin-top: 5px;
+        margin-right: 10px;
+    }
+    .layui-btn-primary{
+        margin-right: 10px;
+        margin-left: 0!important;
+    }
+    label{
+        margin-bottom: 0!important;
+        margin-top: 4px;
+    }
+</style>
+<div class="layui-fluid">
+    <div class="layui-row layui-col-space15" id="app">
+        <!--搜索条件-->
+        <div class="layui-col-md12">
+            <div class="layui-card">
+                <div class="layui-card-header">搜索条件</div>
+                <div class="layui-card-body">
+                    <div class="layui-carousel layadmin-carousel layadmin-shortcut" lay-anim="" lay-indicator="inside" lay-arrow="none" style="background:none">
+                        <form class="layui-form layui-form-pane" action="">
+                                <div class="layui-inline">
+                                    <label class="layui-form-label" style="top: -5.5px;">搜索条件</label>
+                                    <div class="layui-input-inline">
+                                        <input type="text" id="name" name="name" class="layui-input" placeholder="请输入用户编号">
+                                    </div>
+                                </div>
+                                <div class="layui-inline">
+                                    <label class="layui-form-label" style="top: -4.5px">状态</label>
+                                    <div class="layui-input-block">
+                                        <select name="status">
+                                            <option value="">全部</option>
+                                            <option value="1">待发货</option>
+                                            <option value="2">待收货</option>
+                                            <option value="3">已收货</option>
+                                        </select>
+                                    </div>
+                                </div>
+                                <div class="layui-inline">
+                                    <label class="layui-form-label" style="top: -4.5px">状态</label>
+                                    <div class="layui-input-inline">
+                                        <input type="text" id="product" name="product" class="layui-input" placeholder="商品名称">
+                                    </div>
+                                </div>
+                                <div class="layui-inline">
+                                    <div class="layui-input-inline">
+                                        <button class="layui-btn layui-btn-sm layui-btn-normal" lay-submit="search" lay-filter="search">
+                                            <i class="layui-icon layui-icon-search"></i>搜索</button>
+                                    </div>
+                                </div>
+                            </div>
+                        </form>
+                    </div>
+                </div>
+            </div>
+        </div>
+
+        <!-- 中间详细信息-->
+        <div :class="item.col!=undefined ? 'layui-col-sm'+item.col+' '+'layui-col-md'+item.col:'layui-col-sm6 layui-col-md3'"
+             v-for="item in badge" v-cloak="" v-if="item.count > 0">
+        </div>
+        <!--enb-->
+    </div>
+    <!--列表-->
+    <div class="layui-row layui-col-space15">
+        <div class="layui-col-md12">
+            <div class="layui-card">
+                <div class="layui-card-header">场馆列表</div>
+                <div class="layui-card-body">
+                    <table class="layui-hide" id="List" lay-filter="List"></table>
+
+
+                    <script type="text/html" id="image">
+                        <img style="cursor: pointer" lay-event="open_image" src="{{d.image}}">
+                    </script>
+                    <script type="text/html" id="status">
+                        {{# if(d.status==0){ }}
+                        <button class="btn btn-primary btn-xs" type="button">
+                            待发货
+                        </button>
+                        {{#  }else if(d.status==1){ }}
+                        <button class="btn btn-primary btn-xs" type="button">
+                            待收货
+                        </button>
+                        {{#  }else if(d.status==2){ }}
+                        <button class="btn btn-primary btn-xs" type="button">
+                            已收货
+                        </button>
+                        {{#  }; }}
+                    </script>
+                    <script type="text/html" id="act">
+<!--                        <button type="button" class="layui-btn layui-btn-xs layui-btn-normal" onclick="$eb.createModalFrame('商品','{:Url('product')}?id={{d.id}}',{h:1500,w:1400})">-->
+<!--                            商品-->
+<!--                        </button>-->
+                            {{# if(d.status==0){ }}
+                            <button class="btn btn-primary btn-xs" type="button"
+                                    onclick="$eb.createModalFrame('发送货','{:Url('order_goods')}?id={{d.id}}',{w:500,h:400})">
+                                <i class="fa fa-cart-plus"></i> 发送货
+                            </button>
+                            {{#  }else if(d.status > 0){ }}
+                            <button class="btn btn-primary btn-xs" type="button"
+                                    onclick="$eb.createModalFrame('修改','{:Url('order_goods')}?id={{d.id}}',{w:500,h:400})">
+                                <i class="fa fa-cart-plus"></i> 修改
+                            </button>
+                            {{#  }; }}
+                            <button class="btn btn-primary btn-xs" type="button"
+                                    onclick="$eb.createModalFrame('编辑','{:Url('edit')}?id={{d.id}}',{w:650,h:500})">
+                                 收货地址
+                            </button>
+<!--                        <button type="button" class="layui-btn layui-btn-xs layui-btn-danger" lay-event='delete' id="">-->
+<!--                            删除-->
+<!--                        </button>-->
+                    </script>
+                </div>
+            </div>
+        </div>
+    </div>
+    <!--end-->
+</div>
+<script src="{__ADMIN_PATH}js/layuiList.js"></script>
+{/block}
+{block name="script"}
+<script>
+    layList.form.render();
+    layList.tableList('List', "{:Url('list')}", function () {
+        return [
+            {type: 'checkbox'},
+            {field: 'id', title: 'ID', sort: true, event: 'id', width: '5%', templet: '#id'},
+            {field: 'nickname', title: '用户昵称', templet: '#nickname', align: 'center'},
+            {field: 'name', title: '商品名称', templet: '#name',  align: 'center'},
+            {field: 'image', title: '商品图片', templet: '#image', align: 'center', width: '5%'},
+            {field: 'price', title: '商品价格', templet: '#hanging_price', align: 'center'},
+            {field: 'status', title: '状态', templet: '#status', align: 'center'},
+            {field: 'real_name', title: '收货姓名', templet: '#real_name', align: 'center'},
+            {field: 'user_phone', title: '收货手机号', templet: '#user_phone', align: 'center'},
+            {field: 'user_address', title: '收货地址', templet: '#user_address', align: 'center'},
+            {field: 'delivery_name', title: '快递名称', templet: '#delivery_name', align: 'center'},
+            {field: 'delivery_id', title: '快递单号', templet: '#delivery_id', align: 'center'},
+            {field: 'right', title: '操作', align: 'center', toolbar: '#act'},
+        ];
+    });
+
+    //查询
+    layList.search('search',function(where){
+        layList.reload(where,true);
+    });
+
+    //点击事件绑定
+    layList.tool(function (event,data,obj) {
+        switch (event) {
+            case 'delete':
+                var url=layList.U({c:'auction.auction',a:'delete',q:{id:data.id}});
+                var code = {title:"操作提示",text:"确定将该商品移入回收站吗?",type:'info',confirm:'是的,移入回收站'};
+                $eb.$swal('delete',function(){
+                    $eb.axios.get(url).then(function(res){
+                        if(res.status == 200 && res.data.code == 200) {
+                            $eb.$swal('success',res.data.msg);
+                            obj.del();
+                            location.reload();
+                        }else
+                            return Promise.reject(res.data.msg || '删除失败')
+                    }).catch(function(err){
+                        $eb.$swal('error',err);
+                    });
+                },code)
+                break;
+            case 'open_image':
+                $eb.openImage(data.image);
+                break;
+            case 'edit':
+                location.href = layList.U({a:'edit',q:{id:data.id}});
+                break;
+        }
+    })
+
+
+    //改状态
+    layList.switch('status',function (odj,value) {
+        if(odj.elem.checked==true){
+            layList.baseGet(layList.Url({c:'auction.auction',a:'set_status',p:{status:1,id:value}}),function (res) {
+                layList.msg(res.msg, function () {
+                    layList.reload();
+                });
+            });
+        }else{
+            layList.baseGet(layList.Url({c:'auction.auction',a:'set_status',p:{status:0,id:value}}),function (res) {
+                layList.msg(res.msg, function () {
+                    layList.reload();
+                });
+            });
+        }
+    });
+</script>
+{/block}

+ 94 - 0
app/admin/view/auction/auction_deliver/order_goods.php

@@ -0,0 +1,94 @@
+{extend name="public/container"}
+{block name="content"}
+<div class="layui-fluid" style="background: #fff">
+    <form class="layui-form" action="">
+        <div class="layui-form-item">
+            <label class="layui-form-label">选择类型</label>
+            <div class="layui-input-block">
+                <input type="radio" name="type" value="1" lay-filter="type" title="发货" checked>
+<!--                <input type="radio" name="type" value="2" lay-filter="type" title="送货">-->
+<!--                <input type="radio" name="type" value="3" lay-filter="type" title="虚拟">-->
+            </div>
+        </div>
+        <div class="type" data-type="1">
+            <div class="layui-form-item">
+                <label class="layui-form-label">快递公司</label>
+                <div class="layui-input-block">
+                    <select name="delivery_name">
+                        <option value="">请选择</option>
+                        {volist name='$list' id='item' key='k'}
+                        <option value="{$item}">{$item}</option>
+                        {/volist}
+                    </select>
+                </div>
+            </div>
+            <div class="layui-form-item">
+                <label class="layui-form-label">快递单号</label>
+                <div class="layui-input-block">
+                    <input type="text" name="delivery_id"   placeholder="请输入快递单号" autocomplete="off" class="layui-input">
+                </div>
+            </div>
+        </div>
+        <div class="type" data-type="2" style="display: none">
+            <div class="layui-form-item">
+                <label class="layui-form-label">送货人姓名</label>
+                <div class="layui-input-block">
+                    <input type="text" name="sh_delivery_name"   placeholder="请输入送货人姓名" autocomplete="off" class="layui-input">
+                </div>
+            </div>
+            <div class="layui-form-item">
+                <label class="layui-form-label">送货人电话</label>
+                <div class="layui-input-block">
+                    <input type="text" name="sh_delivery_id"   placeholder="请输入送货人电话" autocomplete="off" class="layui-input">
+                </div>
+            </div>
+        </div>
+        <div class="layui-form-item" style="margin:10px 0;padding-bottom: 10px;">
+            <div class="layui-input-block">
+                <button class="layui-btn layui-btn-sm" lay-submit="" lay-filter="delivery">立即提交</button>
+                <button type="reset" class="layui-btn layui-btn-primary layui-btn-sm">重置</button>
+            </div>
+        </div>
+    </form>
+</div>
+<script src="{__ADMIN_PATH}js/layuiList.js"></script>
+{/block}
+{block name="script"}
+<script>
+    var id={$id};
+    layList.form.render();
+    layList.form.on('radio(type)', function(data){
+       $('.type').each(function () {
+           if($(this).data('type') == data.value){
+               $(this).show();
+           }else{
+               $(this).hide();
+           }
+       })
+    });
+    layList.search('delivery',function (data) {
+        console.log(data);
+        if(data.type == '1'){
+            if(!data.delivery_name) return layList.msg('请选择快递公司');
+            if(!data.delivery_id) return layList.msg('请填写快递单号');
+        }
+        if(data.type == '2'){
+            if(!data.sh_delivery_name) return layList.msg('请填写送货人姓名');
+            if(!data.sh_delivery_id) return layList.msg('请填写送货人电话');
+        }
+        var index = layList.layer.load(1, {
+            shade: [0.1,'#fff']
+        });
+        layList.basePost(layList.U({a:'update_delivery',q:{id:id}}),data,function (res) {
+            layList.layer.close(index);
+            layList.msg(res.msg);
+            parent.layer.close(parent.layer.getFrameIndex(window.name));
+            parent.window.frames[parent.$(".page-tabs-content .active").index()].location.reload();
+        },function (res) {
+            layList.layer.close(index);
+            layList.msg(res.msg);
+        });
+    });
+
+</script>
+{/block}

+ 4 - 3
app/api/controller/auction/AuctionController.php

@@ -62,8 +62,11 @@ class AuctionController
         ]);
         if (!$data['id']) return app('json')->fail('数据传入错误');
 
+        Db::startTrans();
         $auction = Auction::lock(true)->find($data['id']);
+        $user = User::find($request->uid());
         if (!$auction)return app('json')->fail('没有此数据');
+        if ($user['shop_integral'] < $auction['threshold']) return app('json')->fail('未到预约门槛');
 
         if (time() < strtotime($auction['add_time'])){
             return app('json')->fail('预约未开始');
@@ -91,13 +94,11 @@ class AuctionController
             }
 
         }
-        $user = User::find($request->uid());
         if ($user['is_auth'] != 2) return app('json')->fail('未实名认证');
-        if ($user['shop_integral'] <= 0) return app('json')->fail('账户内没有购物券,无法进行预约');
+//        if ($user['shop_integral'] <= 0) return app('json')->fail('账户内没有购物券,无法进行预约');
         if ($user['anticipate'] < $auction['anticipate']) return app('json')->fail('广告值不足');
         $user['anticipate'] = $user['anticipate'] - $auction['anticipate'];// 扣除广告值
         try {
-            Db::startTrans();
             $user->save();
             AuctionOrder::create([
                 'uid' => $request->uid(),

+ 111 - 0
app/api/controller/auction/AuctionProductController.php

@@ -3,6 +3,7 @@
 namespace app\api\controller\auction;
 
 
+use app\admin\model\auction\AuctionDeliver;
 use app\admin\model\system\SystemConfig;
 use app\models\auction\Auction;
 use app\models\auction\AuctionBooking;
@@ -12,6 +13,7 @@ use app\models\auction\AuctionOrder;
 use app\models\auction\AuctionProduct;
 use app\models\auction\AuctionTime;
 use app\models\user\User;
+use app\models\user\UserAddress;
 use app\models\user\UserBill;
 use app\Request;
 use crmeb\utils\Redis;
@@ -501,6 +503,115 @@ class AuctionProductController
         return app('json')->successful($data);
     }
 
+    /**
+     * 提货
+     * @param Request $request
+     * @return mixed
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
+     */
+    public function carry(Request $request)
+    {
+        list($addressId, $productId) = UtilService::postMore([
+            ['addressId', ''], ['productId', '']
+        ], $request, true);
+        if (!$addressId) return app('json')->fail('请选择收货地址');
+        if (!$productId) return app('json')->fail('请选择提货商品');
+        $uid = $request->uid();
+        $address = UserAddress::where('id', $addressId)->where('uid', $uid)->find();
+        $product = AuctionProduct::where([['uid','=', $uid], ['id', '=', $productId]])->find();
+        $order = AuctionOrder::where('uid', '<>', $uid)->where('status', '>', 0)->where('product_id', $productId)->where('create_time', '>', strtotime('today'))->find();
+
+        if ($product['is_show'] == 1) return app('json')->fail('商品只能下架后提货');
+        if ($order) return app('json')->fail('该商品出售中,无法提货');
+        if (!$address) return app('json')->fail('收货地址不存在');
+        if (!$product) return app('json')->fail('提货商品不存在');
+
+        Db::startTrans();
+        $res = AuctionDeliver::create([
+            'uid' => $uid,
+            'product_id' => $productId,
+            'name' => $product['name'],
+            'image' => $product['image'],
+            'price' => $product['hanging_price'],
+            'real_name' => $address['real_name'],
+            'user_phone' => $address['phone'],
+            'user_address' => $address['province'].' '.$address['city'].' '.$address['district'].' '.$address['detail'],
+        ]);
+        $res1 = $product->delete();
+        if ($res && $res1){
+            Db::commit();
+            return app('json')->success('提货成功');
+        }else{
+            Db::rollback();
+            return app('json')->fail('提货失败');
+        }
+    }
+
+    /**
+     * 提货订单
+     * @param Request $request
+     * @return mixed
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
+     */
+    public function deliver_list(Request $request)
+    {
+        list($status, $page, $limit) = UtilService::postMore([
+            ['status', 0], ['page', 1], ['limit', 10]
+        ], $request, true);
+        $list = AuctionDeliver::where('uid', $request->uid())
+            ->where('status', $status)
+            ->order('id DESC')
+            ->page($page, $limit)
+            ->select();
+        $list = count($list) > 0? $list->toArray(): [];
+        foreach ($list as &$item){
+            if (!empty($item['goods_time'])) $item['goods_time'] = date('Y-m-d H:i:s', $item['goods_time']);
+            if (!empty($item['collect_time'])) $item['collect_time'] = date('Y-m-d H:i:s', $item['collect_time']);
+        }
+        return app('json')->success($list);
+    }
+
+    /**
+     * 提货订单详情
+     * @param Request $request
+     * @return mixed
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
+     */
+    public function deliver(Request $request)
+    {
+        list($id) = UtilService::postMore([
+            ['id', 0]
+        ], $request, true);
+
+        $details = AuctionDeliver::where('uid', $request->uid())->where('id', $id)->find();
+        if (!$details) return app('json')->fail('订单不存在');
+        if (!empty($details['goods_time'])) $details['goods_time'] = date('Y-m-d H:i:s', $details['goods_time']);
+        if (!empty($details['collect_time'])) $details['collect_time'] = date('Y-m-d H:i:s', $details['collect_time']);
+
+        return app('json')->success($details->toArray());
+    }
+
+    public function collect(Request $request)
+    {
+        list($id) = UtilService::postMore([
+            ['id', 0]
+        ], $request, true);
+        $details = AuctionDeliver::where('uid', $request->uid())->where('id', $id)->find();
+        if (!$details) return app('json')->fail('订单不存在');
+        if ($details['status'] == 0) return app('json')->fail('未发货');
+        if ($details['status'] == 2) return app('json')->fail('已收货');
+
+        $res = AuctionDeliver::where('uid', $request->uid())->where('id', $id)->update(['status' => 2, 'collect_time' => time()]);
+        if ($res) return app('json')->success('确认收货');
+        return app('json')->fail('收货失败');
+    }
+
 
 
 

+ 3 - 1
app/models/auction/AuctionProduct.php

@@ -10,6 +10,7 @@ namespace app\models\auction;
 
 use crmeb\traits\ModelTrait;
 use crmeb\basic\BaseModel;
+use think\model\concern\SoftDelete;
 
 /**
  * 竞拍上坪 Model
@@ -20,11 +21,12 @@ class AuctionProduct extends BaseModel
 {
 
     use ModelTrait;
-
+    use SoftDelete;
     protected $pk = 'id';
 
     protected $name = 'auction_product';
     protected $autoWriteTimestamp = true;
+    protected $deleteTime = 'delete_time';
 
     /**
      * 竞拍商品列表

+ 5 - 0
route/api/route.php

@@ -204,6 +204,11 @@ Route::group(function () {
     Route::post('edit_voucher', 'auction.AuctionOrderController/edit_voucher')->name('edit_voucher');// 修改支付凭证
     Route::post('exchange_golden', 'auction.AuctionController/exchange_golden')->name('exchange_golden');// 金豆兑换
 
+    Route::post('auction/carry', 'auction.AuctionProductController/carry')->name('carry');// 提货
+    Route::get('auction/deliver_list', 'auction.AuctionProductController/deliver_list')->name('deliver_list');// 提货订单
+    Route::get('auction/deliver', 'auction.AuctionProductController/deliver')->name('deliver');// 提货订单详情
+    Route::post('auction/collect', 'auction.AuctionProductController/collect')->name('collect');// 收货
+
 })->middleware(\app\http\middleware\AllowOriginMiddleware::class)->middleware(\app\http\middleware\AuthTokenMiddleware::class, true);
 //未授权接口
 Route::group(function () {

+ 2 - 1
runtime/admin/temp/5435f22dcc53d6dd211a71551ce9d1c0.php

@@ -1,4 +1,4 @@
-<?php /*a:5:{s:69:"D:\phpstudy_pro\WWW\newQudou\app\admin\view\auction\auction\index.php";i:1655951102;s:64:"D:\phpstudy_pro\WWW\newQudou\app\admin\view\public\container.php";i:1595820902;s:65:"D:\phpstudy_pro\WWW\newQudou\app\admin\view\public\frame_head.php";i:1595820902;s:60:"D:\phpstudy_pro\WWW\newQudou\app\admin\view\public\style.php";i:1595820902;s:67:"D:\phpstudy_pro\WWW\newQudou\app\admin\view\public\frame_footer.php";i:1595820902;}*/ ?>
+<?php /*a:5:{s:69:"D:\phpstudy_pro\WWW\newQudou\app\admin\view\auction\auction\index.php";i:1660025791;s:64:"D:\phpstudy_pro\WWW\newQudou\app\admin\view\public\container.php";i:1595820902;s:65:"D:\phpstudy_pro\WWW\newQudou\app\admin\view\public\frame_head.php";i:1595820902;s:60:"D:\phpstudy_pro\WWW\newQudou\app\admin\view\public\style.php";i:1595820902;s:67:"D:\phpstudy_pro\WWW\newQudou\app\admin\view\public\frame_footer.php";i:1595820902;}*/ ?>
 <!DOCTYPE html>
 <html lang="zh-CN">
 <head>
@@ -196,6 +196,7 @@
             {field: 'nickname', title: '竞拍场', templet: '#nickname', align: 'center'},
             {field: 'name', title: '所属场馆', templet: '#name',  align: 'center'},
             {field: 'anticipate', title: '预约价格', templet: '#anticipate',  align: 'center',style : 'color: #DC143C;'},
+            {field: 'threshold', title: '预约门槛', templet: '#threshold',  align: 'center',style : 'color: #DC143C;'},
             {field: 'image', title: '封面', templet: '#image', align: 'center', width: '5%'},
             {field: 'status', title: '状态', templet: '#status', align: 'center'},
             {field: 'goods_time', title: '自动放货(分钟)', templet: '#goods_time', align: 'center'},

+ 1 - 1
runtime/cache/a9/939d920c0fa6b4fe0b897fb019672a.php

@@ -1,4 +1,4 @@
 <?php
 //000000000000
  exit();?>
-a:12:{i:0;s:80:"D:\phpstudy_pro\WWW\newQudou\runtime\cache\48\e345b986ae9584f9686dac64ea2c6a.php";i:1;s:80:"D:\phpstudy_pro\WWW\newQudou\runtime\cache\59\62ccd748530d5866ded674e0247788.php";i:2;s:80:"D:\phpstudy_pro\WWW\newQudou\runtime\cache\4d\ebc178cbdb9b7d1fc736ef8ee65e51.php";i:3;s:80:"D:\phpstudy_pro\WWW\newQudou\runtime\cache\b6\2c1e2a759fad26f36b6705aeb096e7.php";i:4;s:80:"D:\phpstudy_pro\WWW\newQudou\runtime\cache\3a\18e85fda2f43f200f015f30d0af45e.php";i:5;s:80:"D:\phpstudy_pro\WWW\newQudou\runtime\cache\a7\53d3226685fd31b029614775beb88c.php";i:6;s:80:"D:\phpstudy_pro\WWW\newQudou\runtime\cache\57\e5830fa228be4a7d40bf40abfb7a18.php";i:7;s:80:"D:\phpstudy_pro\WWW\newQudou\runtime\cache\e0\f15cee86afad4eabb0d5176f63c302.php";i:8;s:80:"D:\phpstudy_pro\WWW\newQudou\runtime\cache\a6\d6181cf79cbad4a232ed9006617c00.php";i:9;s:80:"D:\phpstudy_pro\WWW\newQudou\runtime\cache\2b\8b07b35c908c382a8aae9b52863147.php";i:10;s:80:"D:\phpstudy_pro\WWW\newQudou\runtime\cache\b0\0eb913440b871528ef5387cdfe695b.php";i:11;s:80:"D:\phpstudy_pro\WWW\newQudou\runtime\cache\33\00542f4b024a761865b3524773716c.php";}
+a:15:{i:0;s:80:"D:\phpstudy_pro\WWW\newQudou\runtime\cache\48\e345b986ae9584f9686dac64ea2c6a.php";i:1;s:80:"D:\phpstudy_pro\WWW\newQudou\runtime\cache\59\62ccd748530d5866ded674e0247788.php";i:2;s:80:"D:\phpstudy_pro\WWW\newQudou\runtime\cache\4d\ebc178cbdb9b7d1fc736ef8ee65e51.php";i:3;s:80:"D:\phpstudy_pro\WWW\newQudou\runtime\cache\b6\2c1e2a759fad26f36b6705aeb096e7.php";i:4;s:80:"D:\phpstudy_pro\WWW\newQudou\runtime\cache\3a\18e85fda2f43f200f015f30d0af45e.php";i:5;s:80:"D:\phpstudy_pro\WWW\newQudou\runtime\cache\a7\53d3226685fd31b029614775beb88c.php";i:6;s:80:"D:\phpstudy_pro\WWW\newQudou\runtime\cache\57\e5830fa228be4a7d40bf40abfb7a18.php";i:7;s:80:"D:\phpstudy_pro\WWW\newQudou\runtime\cache\e0\f15cee86afad4eabb0d5176f63c302.php";i:8;s:80:"D:\phpstudy_pro\WWW\newQudou\runtime\cache\a6\d6181cf79cbad4a232ed9006617c00.php";i:9;s:80:"D:\phpstudy_pro\WWW\newQudou\runtime\cache\2b\8b07b35c908c382a8aae9b52863147.php";i:10;s:80:"D:\phpstudy_pro\WWW\newQudou\runtime\cache\b0\0eb913440b871528ef5387cdfe695b.php";i:11;s:80:"D:\phpstudy_pro\WWW\newQudou\runtime\cache\33\00542f4b024a761865b3524773716c.php";i:12;s:80:"D:\phpstudy_pro\WWW\newQudou\runtime\cache\6d\d957611df2ff766f3850ec3f89b3ab.php";i:13;s:80:"D:\phpstudy_pro\WWW\newQudou\runtime\cache\5c\1a8fbcbeb24f22f3b0b9f0076da820.php";i:14;s:80:"D:\phpstudy_pro\WWW\newQudou\runtime\cache\c8\1e728d9d4c2f636f067f89cc14862c.php";}