| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153 |
- <?php
- // +----------------------------------------------------------------------
- // | LARAVEL8.0 框架 [ LARAVEL ][ RXThinkCMF ]
- // +----------------------------------------------------------------------
- // | 版权所有 2017~2021 LARAVEL研发中心
- // +----------------------------------------------------------------------
- // | 官方网站: http://www.laravel.cn
- // +----------------------------------------------------------------------
- // | Author: laravel开发员 <laravel.qq.com>
- // +----------------------------------------------------------------------
- namespace App\Http\Controllers\Admin;
- use App\Models\AdvertModel;
- use App\Models\AdvertOrderModel;
- use App\Models\TradeOrderModel;
- use App\Services\Common\AdvertOrderService;
- use App\Services\Common\TradeOrderService;
- /**
- * 挂单广告订单控制器
- * Class AdvertOrderController
- * @package App\Http\Controllers\Admin
- */
- class AdvertOrderController extends Backend
- {
- /**
- * 构造函数
- * AdvertOrderController constructor.
- */
- public function __construct()
- {
- $this->model = new AdvertOrderModel();
- $this->service = new AdvertOrderService();
- parent::__construct();
- }
- /**
- * 广告订单
- * @return array|mixed
- */
- public function index()
- {
- $params = request()->all();
- $pageSize = request()->post('limit', 15);
- if($this->userInfo['user_type'] == 2){
- $params['business_id'] = $this->userInfo['user_id'];
- }
- $list = AdvertOrderService::make()->getDataList($params,$pageSize);
- $message = array(
- "msg" => '操作成功',
- "code" => 0,
- "data" => isset($list['list'])? $list['list']:[],
- "count" => isset($list['total'])? $list['total']:0,
- );
- return $message;
- }
- /**
- * 交易员自己的广告订单
- * @return array
- */
- public function business()
- {
- $params = request()->all();
- $pageSize = request()->post('limit', 15);
- $params['user_id'] = $this->userInfo['user_id'];
- $list = AdvertOrderService::make()->getDataList($params,$pageSize);
- $message = array(
- "msg" => '操作成功',
- "code" => 0,
- "data" => isset($list['list'])? $list['list']:[],
- "count" => isset($list['total'])? $list['total']:0,
- );
- return $message;
- }
- /**
- * 购买广告(交易员)
- * @return array
- */
- public function buy()
- {
- $params = request()->post();
- if(!AdvertOrderService::make()->buy($this->userInfo['user_id'], $params)){
- return returnJson(AdvertOrderService::make()->getError(), false);
- }else{
- return returnJson(AdvertOrderService::make()->getError(), true);
- }
- }
- /**
- * 出售广告(交易员)
- * @return array
- */
- public function sell()
- {
- return returnJson(1002);
- }
- /**
- * 确认付款(交易员的客户订单)
- * @return array
- */
- public function pay()
- {
- return returnJson(1002);
- }
- /**
- * 确认付款(交易员的个人订单)
- * @return array
- */
- public function businessPay()
- {
- return returnJson(1002);
- }
- /**
- * 确认收款(交易员客户订单)
- * @return array
- */
- public function collection()
- {
- return returnJson(1002);
- }
- /**
- * 确认收款(交易员的个人订单)
- * @return array
- */
- public function businessCollection()
- {
- return returnJson(1002);
- }
- /**
- * 订单异常处理(交易员申请或平台处理)
- */
- public function exception()
- {
- return returnJson(1002);
- }
- /**
- * 订单取消(交易员或平台操作)
- */
- public function cancel()
- {
- }
- }
|