Commit 5c658fbc by xmy

Merge remote-tracking branch 'origin/master'

parents 0e2401d5 2566f156
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* Date: 2018/7/5 * Date: 2018/7/5
* Time: 15:47 * Time: 15:47
*/ */
namespace Hdll\Services\Buyer; namespace Hdll\Services\Buyer\Lib;
use Swoft\Core\ResultInterface; use Swoft\Core\ResultInterface;
...@@ -21,4 +21,5 @@ interface BuyerInterface ...@@ -21,4 +21,5 @@ interface BuyerInterface
public function updateProfile(string $token, array $data); public function updateProfile(string $token, array $data);
public function hasUser($storeId,$unionid);
} }
\ No newline at end of file
...@@ -59,14 +59,12 @@ class CommonEntity extends Model ...@@ -59,14 +59,12 @@ class CommonEntity extends Model
*/ */
protected function split() protected function split()
{ {
$request = RequestContext::getRequest(); if ( empty(RequestContext::getContextData()) ) {//初始化不做处理
if ( empty($request) ) {//初始化不做处理
return; return;
} }
$testFlag = $request->query('flag');
if ( false === strpos(self::$commentString,"{split}") || $testFlag == 'hdllTest' ) { if ( false === strpos(self::$commentString,"{split}") || App::$isInTest ) {
return; return;
} }
...@@ -86,18 +84,19 @@ class CommonEntity extends Model ...@@ -86,18 +84,19 @@ class CommonEntity extends Model
*/ */
public static function tableName() public static function tableName()
{ {
$request = RequestContext::getRequest();
if ( empty($request) ) {//初始化不做处理 if ( empty(RequestContext::getContextData()) ) {//初始化不做处理
return; return;
} }
$request = RequestContext::getRequest();
$testFlag = $request->query('flag'); $testFlag = $request->query('flag');
//获取注解里的table //获取注解里的table
$res = new \ReflectionClass(static::class); $res = new \ReflectionClass(static::class);
self::$commentString = $res->getDocComment(); self::$commentString = $res->getDocComment();
if ( false !== strpos(self::$commentString,"{split}") && $testFlag != 'hdllTest') { if ( false !== strpos(self::$commentString,"{split}") && App::$isInTest) {
$dbNum = self::getDbNum(); $dbNum = self::getDbNum();
$tableName = self::getTableName().'_'.$dbNum; $tableName = self::getTableName().'_'.$dbNum;
self::setTableName($tableName); self::setTableName($tableName);
......
<?php
namespace Hdll\Services\Reservation\Enum;
class ReservationError
{
const E3001 = ['code'=>400, 'errCode'=>3001, 'msg'=>'客户端传参错误'];
const E3002 = ['code'=>404, 'errCode'=>3002, 'msg'=>'查询不到用户数据'];
const E3003 = ['code'=>401, 'errCode'=>3003, 'msg'=>'无权限操作'];
const E3004 = ['code'=>404, 'errCode'=>3004, 'msg'=>'数据不存在'];
const E3102 = ['code'=>400, 'errCode'=>3102, 'msg'=>'手机号不正确'];
const E3201 = ['code'=>400, 'errCode'=>3201, 'msg'=>'xxxx'];
const E3202 = ['code'=>400, 'errCode'=>3202, 'msg'=>'短信发送失败:'];
const E3203 = ['code'=>400, 'errCode'=>3203, 'msg'=>'验证码不正确'];
const E3204 = ['code'=>400, 'errCode'=>3204, 'msg'=>'xxxx'];
const E3205 = ['code'=>400, 'errCode'=>3205, 'msg'=>'xxxx'];
const E3206 = ['code'=>400, 'errCode'=>3206, 'msg'=>'xxxx'];
const E3207 = ['code'=>400, 'errCode'=>3207, 'msg'=>'xxxx'];
const E3208 = ['code'=>400, 'errCode'=>3208, 'msg'=>'xxxx'];
const E3209 = ['code'=>400, 'errCode'=>3209, 'msg'=>'xxxx'];
const E3210 = ['code'=>400, 'errCode'=>3210, 'msg'=>'xxxx'];
public static function getError($code) {
$reflect = new \ReflectionClass(__CLASS__);
return $reflect->getConstant('E'.$code);
}
}
\ No newline at end of file
<?php
/**
* This file is part of Swoft.
*
* @link https://swoft.org
* @document https://doc.swoft.org
* @contact group@swoft.org
* @license https://github.com/swoft-cloud/swoft/blob/master/LICENSE
*/
namespace Hdll\Services\Reservation\Lib;
use Swoft\Core\ResultInterface;
/**
* The interface of Schedule service
*
* @method ResultInterface deferGetScheduleList(int $storeId, int $month=null)
* @method ResultInterface deferGetScheduleByDateId(int $storeId, int $dateId)
* @method ResultInterface deferUpdateSchedule(int $storeId, int $dateId, array $data)
* @method ResultInterface deferAddSchedule(int $storeId, int $dateId, array $data)
*/
interface ReservationInterface
{
}
\ No newline at end of file
<?php
namespace Hdll\Services\Schedule\Enum;
class ScheduleError
{
const E8001 = ['code'=>400, 'errCode'=>8001, 'msg'=>'客户端传参错误'];
const E8002 = ['code'=>404, 'errCode'=>8002, 'msg'=>'查询不到用户数据'];
const E8003 = ['code'=>401, 'errCode'=>8003, 'msg'=>'无权限操作'];
const E8004 = ['code'=>404, 'errCode'=>8004, 'msg'=>'数据不存在'];
const E8102 = ['code'=>400, 'errCode'=>8102, 'msg'=>'手机号不正确'];
const E8201 = ['code'=>400, 'errCode'=>8201, 'msg'=>'xxxx'];
const E8202 = ['code'=>400, 'errCode'=>8202, 'msg'=>'短信发送失败:'];
const E8203 = ['code'=>400, 'errCode'=>8203, 'msg'=>'验证码不正确'];
const E8204 = ['code'=>400, 'errCode'=>8204, 'msg'=>'xxxx'];
const E8205 = ['code'=>400, 'errCode'=>8205, 'msg'=>'xxxx'];
const E8206 = ['code'=>400, 'errCode'=>8206, 'msg'=>'xxxx'];
const E8207 = ['code'=>400, 'errCode'=>8207, 'msg'=>'xxxx'];
const E8208 = ['code'=>400, 'errCode'=>8208, 'msg'=>'xxxx'];
const E8209 = ['code'=>400, 'errCode'=>8209, 'msg'=>'xxxx'];
const E8210 = ['code'=>400, 'errCode'=>8210, 'msg'=>'xxxx'];
public static function getError($code) {
$reflect = new \ReflectionClass(__CLASS__);
return $reflect->getConstant('E'.$code);
}
}
\ No newline at end of file
<?php
/**
* This file is part of Swoft.
*
* @link https://swoft.org
* @document https://doc.swoft.org
* @contact group@swoft.org
* @license https://github.com/swoft-cloud/swoft/blob/master/LICENSE
*/
namespace Hdll\Services\Schedule\Lib;
use Swoft\Core\ResultInterface;
/**
* The interface of Schedule service
*
* @method ResultInterface deferGetScheduleList(int $storeId, int $month=null)
* @method ResultInterface deferGetScheduleByDateId(int $storeId, int $dateId)
* @method ResultInterface deferUpdateSchedule(int $storeId, int $dateId, array $data)
* @method ResultInterface deferAddSchedule(int $storeId, int $dateId, array $data)
*/
interface ScheduleInterface
{
/**
* 获取店铺所有日程列表
*
* @param integer $storeId
* @param integer $month 可选参数 指定要查哪个月份的日程列表,格式如:201810
* @return array 空数组表示没有查询到记录
*/
public function getScheduleList(int $storeId, int $month = null);
/**
* 获取某天的日程信息
*
* @param integer $storeId
* @param integer $dateId 要查询的日期id,格式要求如:20180803
* @return array 空数组表示没有查询到记录
*/
public function getScheduleByDateId(int $storeId, int $dateId);
/**
* 根据dateId修改某个日程的信息
*
* @param integer $storeId
* @param integer $dateId 要修改的日期id,格式要求如:20180803
* @param array $data
* 参数 $data 字段说明:
* ['offday'] => 是否是休息日,0不是,1是
*
* @return int 成功更新的条数
*/
public function updateSchedule(int $storeId, int $dateId, array $data);
/**
* 添加一个日程安排
*
* @param integer $storeId
* @param integer $dateId 要添加的日期id,格式要求如:20180803
* @param array $data
* 参数 $data 字段说明:
* ['offday'] => 是否是休息日,0不是,1是
*
* @return int
*/
public function addSchedule(int $storeId, int $dateId, array $data);
}
\ No newline at end of file
...@@ -23,7 +23,7 @@ class StoreError ...@@ -23,7 +23,7 @@ class StoreError
const E5210 = ['code'=>400, 'errCode'=>5210, 'msg'=>'xxxx']; const E5210 = ['code'=>400, 'errCode'=>5210, 'msg'=>'xxxx'];
public static function getError($code) { public static function getError($code) {
$reflect = new \ReflectionClass(StoreError::class); $reflect = new \ReflectionClass(__CLASS__);
return $reflect->getConstant('E'.$code); return $reflect->getConstant('E'.$code);
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment