|
@@ -25,6 +25,7 @@ class Staff extends BaseController {
|
|
|
* @OA\Parameter(name="page", in="query", description="页码", @OA\Schema(type="ineger",default="1")),
|
|
|
* @OA\Parameter(name="pageSize", in="query", description="页尺寸", @OA\Schema(type="integer",default="10")),
|
|
|
* @OA\Parameter(name="status", in="query", description="状态 1正常 2删除", @OA\Schema(type="integer",default="1")),
|
|
|
+ * @OA\Parameter(name="serverStatus", in="query", description="服务状态1空闲 2待服务 3服务中", @OA\Schema(type="integer",default="1")),
|
|
|
* @OA\Parameter(name="name", in="query", description="职员名", @OA\Schema(type="string")),
|
|
|
* @OA\Parameter(name="mobile", in="query", description="手机号", @OA\Schema(type="string")),
|
|
|
* @OA\Parameter(name="storeId", in="query", description="门店(多个逗号分隔)", @OA\Schema(type="integer")),
|
|
@@ -52,6 +53,10 @@ class Staff extends BaseController {
|
|
|
$where[] = ['s.staff_name|s.staff_code', 'like', "%{$input['name']}%"];
|
|
|
}
|
|
|
|
|
|
+ if (!empty($input['serverStatus'])) {
|
|
|
+ $where[] = ['s.server_status', '=', $input['serverStatus']];
|
|
|
+ }
|
|
|
+
|
|
|
if (!empty($input['mobile'])) {
|
|
|
$where[] = ['s.mobile', 'like', "%{$input['mobile']}%"];
|
|
|
}
|
|
@@ -192,21 +197,33 @@ class Staff extends BaseController {
|
|
|
* summary="获取排班职员列表",
|
|
|
* @OA\Parameter(name="token", in="header", description="token", @OA\Schema(type="string")),
|
|
|
* @OA\Parameter(name="storeId", in="query", description="门店id", @OA\Schema(type="ineger",default="1")),
|
|
|
+ * @OA\Parameter(name="serverStatus", in="query", description="服务状态1空闲 2待服务 3服务中", @OA\Schema(type="ineger",default="1")),
|
|
|
* @OA\RequestBody(
|
|
|
* ),
|
|
|
* @OA\Response(response="200", description="请求成功")
|
|
|
* )
|
|
|
*/
|
|
|
- public function turnStaffList($id, $status) {
|
|
|
+ public function turnStaffList() {
|
|
|
$input = Until::getInput();
|
|
|
$rule = [
|
|
|
- 'storeId|storeId' => 'require',
|
|
|
+ 'storeId' => 'require',
|
|
|
+ 'serverStatus' => 'require',
|
|
|
];
|
|
|
Until::check($rule, $input);
|
|
|
$model = new StaffModel();
|
|
|
- $where[] = ['id', '=', (int)$id];
|
|
|
- $data = ['status' => (int)$status];
|
|
|
- $isSuccess = $model::where($where)->update($data);
|
|
|
- Until::output(['isSuccess' => $isSuccess]);
|
|
|
+ $where[] = ['s.status', '=', 1];
|
|
|
+ if (!empty($input['storeId'])) {
|
|
|
+ $where[] = ['sto.id', '=', (int)$input['storeId']];
|
|
|
+ }
|
|
|
+ if (!empty($input['serverStatus'])) {
|
|
|
+ $where[] = ['s.server_status', '=', (int)$input['serverStatus']];
|
|
|
+ }
|
|
|
+ $model->setWhere($where);
|
|
|
+ $data = $model->getTurnList();
|
|
|
+ foreach ($data['list'] as &$v) {
|
|
|
+ $v['today_order_num'] = $v['today_order_num'] ?: 0;
|
|
|
+ $v['yesterday_order_num'] = $v['yesterday_order_num'] ?: 0;
|
|
|
+ }
|
|
|
+ Until::output($data);
|
|
|
}
|
|
|
}
|