| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- <?php
- namespace app\api\controller;
- use app\adminapi\validate\property\PropertyOrderValidate;
- use app\api\lists\property\PropertyCommissionLists;
- use app\api\lists\property\PropertyOrderLists;
- use app\api\lists\property\PropertySurplusLogLists;
- use app\api\logic\PropertyCommissionLogic;
- use app\api\logic\PropertyOrderLogic;
- use app\api\logic\ServiceOrderLogic;
- use app\api\validate\PropertyValidate;
- use app\api\validate\ServiceOrderValidate;
- use app\common\model\orders\RechargeOrder;
- use think\facade\Log;
- /**
- * 物业模块类
- */
- class PropertyController extends BaseApiController
- {
- public array $notNeedLogin = ['orderByQrcode'];
- /**
- * @notes 用户绑定物业信息
- * @return \think\response\Json
- */
- public function bindProperty()
- {
- $params = (new PropertyOrderValidate())->post()->goCheck('bind', [
- 'householder_name'=>'',
- 'householder_mobile'=>$this->userInfo['mobile']
- ]);
- Log::info('物业ID-11');
- $result = PropertyOrderLogic::bind($params);
- if (true === $result) {
- return $this->success('下单成功', [], 1, 1);
- }
- return $this->fail(PropertyOrderLogic::getError());
- }
- /**
- * @notes 二维码扫码下物业单
- * @return \think\response\Json
- */
- public function orderByQrcode()
- {
- $params = (new PropertyOrderValidate())->post()->goCheck('add');
- $result = PropertyOrderLogic::add($params);
- if (true === $result) {
- return $this->success('下单成功', [], 1, 1);
- }
- return $this->fail(PropertyOrderLogic::getError());
- }
- /**
- * 提现申请
- * @return \think\response\Json
- */
- public function withdrawCash()
- {
- $params = (new PropertyValidate())->post()->goCheck('withdrawCash', [
- 'user_id' => $this->userId,
- 'user_info' => $this->userInfo
- ]);
- $result = PropertyCommissionLogic::withdrawCash($params);
- if (false === $result) {
- return $this->fail(PropertyCommissionLogic::getError());
- }
- return $this->success('申请成功,等待审核', [], 1, 1);
- }
- /**
- * 物业负责人资金账户信息
- * @return \think\response\Json
- */
- public function assetAccount()
- {
- $params = [
- 'user_id' => $this->userId,
- 'user_info' => $this->userInfo
- ];
- return $this->success('资金账户', PropertyCommissionLogic::assetAccount($params), 1, 1);
- }
- /**
- * 下单列表
- * @return \think\response\Json
- */
- public function orderLists()
- {
- return $this->dataLists(new PropertyOrderLists());
- }
- /**
- * 进出记录列表
- * @return \think\response\Json
- */
- public function surplusLists()
- {
- return $this->dataLists(new PropertySurplusLogLists());
- }
- /**
- * 分成列表
- * @return \think\response\Json
- */
- public function commissionLists()
- {
- return $this->dataLists(new PropertyCommissionLists());
- }
- /**
- * 订单支付详情
- * @return \think\response\Json
- */
- public function commissionOrderDetail()
- {
- $params = (new ServiceOrderValidate())->goCheck('detail');
- //获取订单用户信息
- $params['user_id'] = RechargeOrder::where('sn',$params['sn'])->value('user_id');
- $result = ServiceOrderLogic::orderPayInfo($params);
- if (false === $result) {
- return $this->fail(ServiceOrderLogic::getError());
- }
- return $this->data($result);
- }
- }
|