作者 郭盛
1 个管道 的构建 通过 耗费 9 秒

回收员订单

... ... @@ -2,7 +2,8 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="0011664b-87e9-41bd-9f37-18792fb15777" name="Default" comment="">
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/api/index/controller/SubscribeController.php" afterPath="$PROJECT_DIR$/api/index/controller/SubscribeController.php" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/api/index/controller/UserController.php" afterPath="$PROJECT_DIR$/api/index/controller/UserController.php" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="TRACKING_ENABLED" value="true" />
... ... @@ -24,11 +25,11 @@
</component>
<component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file leaf-file-name="UserController.php" pinned="false" current-in-tab="false">
<file leaf-file-name="UserController.php" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/api/index/controller/UserController.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="332">
<caret line="419" column="16" lean-forward="true" selection-start-line="419" selection-start-column="16" selection-end-line="419" selection-end-column="16" />
<state relative-caret-position="532">
<caret line="768" column="29" lean-forward="true" selection-start-line="768" selection-start-column="29" selection-end-line="768" selection-end-column="29" />
<folding>
<element signature="e#345#694#0#PHP" expanded="false" />
<element signature="e#699#1464#0#PHP" expanded="false" />
... ... @@ -59,17 +60,31 @@
<element signature="e#17026#17635#0#PHP" expanded="false" />
<element signature="e#17640#18973#0#PHP" expanded="false" />
<element signature="e#18979#19336#0#PHP" expanded="false" />
<element signature="e#19341#20183#0#PHP" expanded="false" />
<element signature="e#19341#20222#0#PHP" expanded="false" />
<element signature="e#20228#20580#0#PHP" expanded="false" />
<element signature="e#20585#21662#0#PHP" expanded="false" />
<element signature="e#21668#22023#0#PHP" expanded="false" />
<element signature="e#22028#23108#0#PHP" expanded="false" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="SubscribeController.php" pinned="false" current-in-tab="true">
<file leaf-file-name="RestBaseController.php" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/simplewind/cmf/controller/RestBaseController.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="210">
<caret line="93" column="57" lean-forward="false" selection-start-line="93" selection-start-column="57" selection-end-line="93" selection-end-column="57" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="SubscribeController.php" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/api/index/controller/SubscribeController.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="357">
<caret line="170" column="34" lean-forward="true" selection-start-line="170" selection-start-column="34" selection-end-line="170" selection-end-column="34" />
<state relative-caret-position="532">
<caret line="136" column="0" lean-forward="true" selection-start-line="136" selection-start-column="0" selection-end-line="136" selection-end-column="0" />
<folding>
<element signature="e#305#577#0#PHP" expanded="false" />
<element signature="e#583#854#0#PHP" expanded="false" />
... ... @@ -79,6 +94,7 @@
<element signature="e#2497#2911#0#PHP" expanded="false" />
<element signature="e#2916#3386#0#PHP" expanded="false" />
<element signature="e#3393#3889#0#PHP" expanded="false" />
<element signature="e#3894#4897#0#PHP" expanded="false" />
</folding>
</state>
</provider>
... ... @@ -139,7 +155,6 @@
<option value="$PROJECT_DIR$/api/config.php" />
<option value="$PROJECT_DIR$/api/wxapp/controller/PublicController.php" />
<option value="$PROJECT_DIR$/api/index/controller/HomeController.php" />
<option value="$PROJECT_DIR$/simplewind/cmf/controller/RestBaseController.php" />
<option value="$PROJECT_DIR$/app/user/controller/AdminIndexController.php" />
<option value="$PROJECT_DIR$/public/themes/admin_simpleboot3/user/admin_index/index.html" />
<option value="$PROJECT_DIR$/app/admin/controller/UserController.php" />
... ... @@ -153,8 +168,9 @@
<option value="$PROJECT_DIR$/app/admin/controller/SubhomeController.php" />
<option value="$PROJECT_DIR$/public/themes/admin_simpleboot3/admin/subhome/index.html" />
<option value="$PROJECT_DIR$/public/themes/simpleboot3/index/index.html" />
<option value="$PROJECT_DIR$/api/index/controller/UserController.php" />
<option value="$PROJECT_DIR$/api/index/controller/SubscribeController.php" />
<option value="$PROJECT_DIR$/simplewind/cmf/controller/RestBaseController.php" />
<option value="$PROJECT_DIR$/api/index/controller/UserController.php" />
</list>
</option>
</component>
... ... @@ -173,8 +189,8 @@
</component>
<component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" />
<component name="ProjectFrameBounds">
<option name="x" value="316" />
<option name="y" value="57" />
<option name="x" value="891" />
<option name="y" value="7" />
<option name="width" value="1582" />
<option name="height" value="969" />
</component>
... ... @@ -203,55 +219,20 @@
<path>
<item name="scrap" type="b2602c69:ProjectViewProjectNode" />
<item name="scrap" type="2a2b976b:PhpTreeStructureProvider$1" />
<item name="app" type="2a2b976b:PhpTreeStructureProvider$1" />
<item name="api" type="2a2b976b:PhpTreeStructureProvider$1" />
</path>
<path>
<item name="scrap" type="b2602c69:ProjectViewProjectNode" />
<item name="scrap" type="2a2b976b:PhpTreeStructureProvider$1" />
<item name="app" type="2a2b976b:PhpTreeStructureProvider$1" />
<item name="admin" type="2a2b976b:PhpTreeStructureProvider$1" />
</path>
<path>
<item name="scrap" type="b2602c69:ProjectViewProjectNode" />
<item name="scrap" type="2a2b976b:PhpTreeStructureProvider$1" />
<item name="app" type="2a2b976b:PhpTreeStructureProvider$1" />
<item name="admin" type="2a2b976b:PhpTreeStructureProvider$1" />
<item name="controller" type="2a2b976b:PhpTreeStructureProvider$1" />
</path>
<path>
<item name="scrap" type="b2602c69:ProjectViewProjectNode" />
<item name="scrap" type="2a2b976b:PhpTreeStructureProvider$1" />
<item name="public" type="2a2b976b:PhpTreeStructureProvider$1" />
</path>
<path>
<item name="scrap" type="b2602c69:ProjectViewProjectNode" />
<item name="scrap" type="2a2b976b:PhpTreeStructureProvider$1" />
<item name="public" type="2a2b976b:PhpTreeStructureProvider$1" />
<item name="themes" type="2a2b976b:PhpTreeStructureProvider$1" />
</path>
<path>
<item name="scrap" type="b2602c69:ProjectViewProjectNode" />
<item name="scrap" type="2a2b976b:PhpTreeStructureProvider$1" />
<item name="public" type="2a2b976b:PhpTreeStructureProvider$1" />
<item name="themes" type="2a2b976b:PhpTreeStructureProvider$1" />
<item name="simpleboot3" type="2a2b976b:PhpTreeStructureProvider$1" />
</path>
<path>
<item name="scrap" type="b2602c69:ProjectViewProjectNode" />
<item name="scrap" type="2a2b976b:PhpTreeStructureProvider$1" />
<item name="public" type="2a2b976b:PhpTreeStructureProvider$1" />
<item name="themes" type="2a2b976b:PhpTreeStructureProvider$1" />
<item name="simpleboot3" type="2a2b976b:PhpTreeStructureProvider$1" />
<item name="api" type="2a2b976b:PhpTreeStructureProvider$1" />
<item name="index" type="2a2b976b:PhpTreeStructureProvider$1" />
</path>
<path>
<item name="scrap" type="b2602c69:ProjectViewProjectNode" />
<item name="scrap" type="2a2b976b:PhpTreeStructureProvider$1" />
<item name="public" type="2a2b976b:PhpTreeStructureProvider$1" />
<item name="themes" type="2a2b976b:PhpTreeStructureProvider$1" />
<item name="simpleboot3" type="2a2b976b:PhpTreeStructureProvider$1" />
<item name="api" type="2a2b976b:PhpTreeStructureProvider$1" />
<item name="index" type="2a2b976b:PhpTreeStructureProvider$1" />
<item name="user" type="2a2b976b:PhpTreeStructureProvider$1" />
<item name="controller" type="2a2b976b:PhpTreeStructureProvider$1" />
</path>
</expand>
<select />
... ... @@ -350,15 +331,15 @@
<workItem from="1574986868818" duration="22318000" />
<workItem from="1575016153150" duration="3315000" />
<workItem from="1575246616478" duration="21722000" />
<workItem from="1575278769037" duration="233000" />
<workItem from="1575278769037" duration="7368000" />
</task>
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="403296000" />
<option name="totallyTimeSpent" value="410431000" />
</component>
<component name="ToolWindowManager">
<frame x="316" y="57" width="1582" height="969" extended-state="0" />
<frame x="891" y="7" width="1582" height="969" extended-state="0" />
<editor active="true" />
<layout>
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.19250986" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
... ... @@ -580,13 +561,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/simplewind/cmf/controller/RestBaseController.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="515">
<caret line="119" column="42" lean-forward="true" selection-start-line="119" selection-start-column="42" selection-end-line="119" selection-end-column="42" />
</state>
</provider>
</entry>
<entry file="jar://$APPLICATION_HOME_DIR$/lib/phpstorm.jar!/resources/html5-schema/html5/tables.rnc">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="273">
... ... @@ -755,10 +729,44 @@
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/public/themes/simpleboot3/index/index.html" />
<entry file="file://$PROJECT_DIR$/app/admin/controller/AttrController.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="200">
<caret line="51" column="12" lean-forward="false" selection-start-line="51" selection-start-column="12" selection-end-line="54" selection-end-column="15" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/api/index/controller/SubscribeController.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="532">
<caret line="136" column="0" lean-forward="true" selection-start-line="136" selection-start-column="0" selection-end-line="136" selection-end-column="0" />
<folding>
<element signature="e#305#577#0#PHP" expanded="false" />
<element signature="e#583#854#0#PHP" expanded="false" />
<element signature="e#859#1113#0#PHP" expanded="false" />
<element signature="e#1119#1594#0#PHP" expanded="false" />
<element signature="e#1599#2490#0#PHP" expanded="false" />
<element signature="e#2497#2911#0#PHP" expanded="false" />
<element signature="e#2916#3386#0#PHP" expanded="false" />
<element signature="e#3393#3889#0#PHP" expanded="false" />
<element signature="e#3894#4897#0#PHP" expanded="false" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/simplewind/cmf/controller/RestBaseController.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="210">
<caret line="93" column="57" lean-forward="false" selection-start-line="93" selection-start-column="57" selection-end-line="93" selection-end-column="57" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/api/index/controller/UserController.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="332">
<caret line="419" column="16" lean-forward="true" selection-start-line="419" selection-start-column="16" selection-end-line="419" selection-end-column="16" />
<state relative-caret-position="532">
<caret line="768" column="29" lean-forward="true" selection-start-line="768" selection-start-column="29" selection-end-line="768" selection-end-column="29" />
<folding>
<element signature="e#345#694#0#PHP" expanded="false" />
<element signature="e#699#1464#0#PHP" expanded="false" />
... ... @@ -789,32 +797,11 @@
<element signature="e#17026#17635#0#PHP" expanded="false" />
<element signature="e#17640#18973#0#PHP" expanded="false" />
<element signature="e#18979#19336#0#PHP" expanded="false" />
<element signature="e#19341#20183#0#PHP" expanded="false" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/admin/controller/AttrController.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="200">
<caret line="51" column="12" lean-forward="false" selection-start-line="51" selection-start-column="12" selection-end-line="54" selection-end-column="15" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/api/index/controller/SubscribeController.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="357">
<caret line="170" column="34" lean-forward="true" selection-start-line="170" selection-start-column="34" selection-end-line="170" selection-end-column="34" />
<folding>
<element signature="e#305#577#0#PHP" expanded="false" />
<element signature="e#583#854#0#PHP" expanded="false" />
<element signature="e#859#1113#0#PHP" expanded="false" />
<element signature="e#1119#1594#0#PHP" expanded="false" />
<element signature="e#1599#2490#0#PHP" expanded="false" />
<element signature="e#2497#2911#0#PHP" expanded="false" />
<element signature="e#2916#3386#0#PHP" expanded="false" />
<element signature="e#3393#3889#0#PHP" expanded="false" />
<element signature="e#19341#20222#0#PHP" expanded="false" />
<element signature="e#20228#20580#0#PHP" expanded="false" />
<element signature="e#20585#21662#0#PHP" expanded="false" />
<element signature="e#21668#22023#0#PHP" expanded="false" />
<element signature="e#22028#23108#0#PHP" expanded="false" />
</folding>
</state>
</provider>
... ...
... ... @@ -618,6 +618,7 @@ class UserController extends RestBaseController
*/
public function collect()
{
$user_id = $this->getUserId();
$where['status'] = ['eq',0];
$data = Db::name('subscribe')
->where($where)
... ... @@ -641,4 +642,139 @@ class UserController extends RestBaseController
$this->success('success',$data);
}
/**
* @title 回收员已接单订单
* @description 回收员已接单订单
* @author Guosheng
* @url /index/User/jie
* @method GET
*
* @header name:XX-Token require:1 default: desc:token
*
* @return id:订单ID
* @return num:订单号
* @return goods_name:商品名称
* @return create_time:创建时间
* @return sub_time:预约时间
*
*/
public function jie()
{
$user_id = $this->getUserId();
$list = Db::name('collector')
->where('user_id',$user_id)
->where('status',1)
->select()
->toArray();
foreach ($list as &$val){
$val['order_id'] = Db::name('subscribe')
->where('id',$val['order_id'])
->field('id,num,create_time,sub_time,attr_id')
->find();
$attr_id = explode(',',$val['order_id']['attr_id']);
$val['order_id']['attr_id'] = [];
foreach ($attr_id as &$v1){
$v1 = Db::name('attr')
->alias('a')
->join('rgoods r','a.rgoods_id=r.id')
->field('r.rgoods_name')
->where('a.id',$v1)
->find();
array_push($val['order_id']['attr_id'],$v1['rgoods_name']);
}
$val['order_id']['attr_id'] = implode(',',$val['order_id']['attr_id']);
}
$this->success('success',$list);
}
/**
* @title 回收员已完成订单
* @description 回收员已完成订单
* @author Guosheng
* @url /index/User/finish
* @method GET
*
* @header name:XX-Token require:1 default: desc:token
*
* @return id:订单ID
* @return num:订单号
* @return goods_name:商品名称
* @return create_time:创建时间
* @return sub_time:预约时间
*
*/
public function finish()
{
$user_id = $this->getUserId();
$list = Db::name('collector')
->where('user_id',$user_id)
->where('status',2)
->select()
->toArray();
foreach ($list as &$val){
$val['order_id'] = Db::name('subscribe')
->where('id',$val['order_id'])
->field('id,num,create_time,sub_time,attr_id')
->find();
$attr_id = explode(',',$val['order_id']['attr_id']);
$val['order_id']['attr_id'] = [];
foreach ($attr_id as &$v1){
$v1 = Db::name('attr')
->alias('a')
->join('rgoods r','a.rgoods_id=r.id')
->field('r.rgoods_name')
->where('a.id',$v1)
->find();
array_push($val['order_id']['attr_id'],$v1['rgoods_name']);
}
$val['order_id']['attr_id'] = implode(',',$val['order_id']['attr_id']);
}
$this->success('success',$list);
}
/**
* @title 回收员确认接单
* @description 回收员确认接单
* @author Guosheng
* @url /index/User/affirm
* @method GET
*
* @header name:XX-Token require:1 default: desc:token
*
* @param name:order_id type:int require:1 other: desc:订单ID
*
* @return id:订单ID
* @return num:订单号
* @return goods_name:商品名称
* @return create_time:创建时间
* @return sub_time:预约时间
*
*/
public function affirm()
{
$user_id = $this->getUserId();
$order_id = $this->request->param('order_id');
if(empty($order_id)){
$this->error('缺少必要参数');
}
$data['order_id'] = $order_id;
$data['user_id'] = $user_id;
$data['create_time'] = time();
Db::name('subscribe')
->where('id',$order_id)
->update(['status'=>1]);
$res = Db::name('collector')
->insertGetId($data);
if($res){
$this->success('接单成功');
}else{
$this->error('sql语句错误');
}
}
}
\ No newline at end of file
... ...