1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- <?php
- /**
- * 加盟管理Model
- * Created by PhpStorm.
- * User: 小威
- * Date: 2020/03/25
- * Time: 16:20
- */
- namespace JinDouYun\Model\Manage;
- use Exception;
- use Mall\Framework\Core\ErrorCode;
- use Mall\Framework\Core\StatusCode;
- use Mall\Framework\Core\ResultWrapper;
- use JinDouYun\Dao\Manage\DJoin;
- use JinDouYun\Dao\Manage\DReservation;
- use JinDouYun\Model\Shop\MShop;
- use JinDouYun\Model\Department\MStaff;
- class MJoin
- {
- private $objDJoin;
- private $objDReservation;
- public function __construct()
- {
- $this->objDJoin = new DJoin('manage');
- $this->objDReservation = new DReservation('manage');
- }
- /**
- * 加盟列表
- * @return ResultWrapper
- * @throws Exception
- */
- public function getAllJoin()
- {
- $dbResult = $this->objDJoin->select();
- if($dbResult === false){
- return ResultWrapper::fail($this->objDJoin->error(), ErrorCode::$dberror);
- }
- return ResultWrapper::success($dbResult);
- }
- /**
- * 加盟添加
- * @param $params
- * @return ResultWrapper
- */
- public function addJoin($params)
- {
- $dbResult = $this->objDJoin->insert($params);
- if($dbResult === false){
- return ResultWrapper::fail($this->objDJoin->error(), ErrorCode::$dberror);
- }
- return ResultWrapper::success($dbResult);
- }
- /**
- * 预约列表
- */
- public function getAllReservation()
- {
- $dbResult = $this->objDReservation->select();
- if($dbResult === false){
- return ResultWrapper::fail($this->objDReservation->error(), ErrorCode::$dberror);
- }
- return ResultWrapper::success($dbResult);
- }
- /**
- * 预约添加
- * @param $params
- * @return ResultWrapper
- */
- public function addReservation($params)
- {
- $dbResult = $this->objDReservation->insert($params);
- if($dbResult === false){
- return ResultWrapper::fail($this->objDReservation->error(), ErrorCode::$dberror);
- }
- return ResultWrapper::success($dbResult);
- }
- }
|