getFind([ 'store_id' => $param['store_id'] ], $param['fields']); return callBack(statusCode()['success'], '查询成功', $info); } catch (\Exception $e) { return callBack(statusCode()['success'], '查询成功', []); } } /** * 价格按条码秤价格权限 * @param $param * [ * store_id * code_price_state 0关闭 1开启 * ] * @return mixed */ public function codePriceState($param) { if (empty($param['store_id'])) { return callBack(statusCode()['error'], '缺少门店唯一标识'); } $where = [ 'store_id' => $param['store_id'] ]; $data = [ 'store_id' => $param['store_id'], 'code_price_state' => $param['code_price_state'] ]; $configModel = new StoreConfigModel(); $id = $configModel->getFindField($where, 'id'); if (!empty($id)) { //修改 unset($data['store_id']); $result = $configModel->updateOrder($where, $data); } else { //添加 $result = $configModel->addOrder($data); } if ($result) { return callBack(statusCode()['success'], '修改成功'); } else { return callBack(statusCode()['error'], '暂无修改'); } } /** * 查询权限 * @param $param * [ * store_id * field 查询的权限字段 * ] * @return int */ public function checkSingleAuth($param) { try { $StoreAuthModel = new RetailStoreAuthModel(); $field_name = $StoreAuthModel->getFindField(['storeid' => $param['store_id']], $param['field']); return $field_name; } catch (\Exception $e) { return ''; } } }