60 lines
1.8 KiB
PHP
Executable File
60 lines
1.8 KiB
PHP
Executable File
<?php
|
|
// +----------------------------------------------------------------------
|
|
// | 宏驰云科技开发团队 版权所有 拥有最终解释权
|
|
// +----------------------------------------------------------------------
|
|
|
|
// | Author: HcyShop-kiki
|
|
// +----------------------------------------------------------------------
|
|
namespace app\api\controller;
|
|
|
|
use app\api\logic\ShareLogic;
|
|
use app\common\model\BargainLaunch;
|
|
|
|
class Share extends ApiBase
|
|
{
|
|
public function shareGoods()
|
|
{
|
|
$id = $this->request->get('id');
|
|
$url = $this->request->get('url');
|
|
$client = $this->client;
|
|
if ($id && $url) {
|
|
$result = ShareLogic::shareGoods($this->user_id, $id, $url, $client);
|
|
$this->_success($result['msg'], $result['data'], $result['code']);
|
|
}
|
|
$this->_error('缺少参数', '');
|
|
}
|
|
|
|
|
|
/**
|
|
* Notes: 用户分销海报
|
|
* @return array
|
|
* @author kiki
|
|
*/
|
|
public function userPoster()
|
|
{
|
|
$url = $this->request->get('url');
|
|
$client = $this->client;
|
|
if (empty($client)) {
|
|
$this->_error('参数缺失');
|
|
}
|
|
$result = ShareLogic::getUserPoster($this->user_id, $url, $client);
|
|
return $result;
|
|
}
|
|
|
|
/**
|
|
* Notes:砍价分享
|
|
* @author:kiki
|
|
*/
|
|
public function shareBargain()
|
|
{
|
|
$id = $this->request->get('id');
|
|
$url = $this->request->get('url');
|
|
$client = $this->client;
|
|
$result = $this->validate(['id' => $id, 'url' => $url], 'app\api\validate\Bargain.share');
|
|
if (true === $result) {
|
|
$result = ShareLogic::shareBargain($this->user_id, $id, $url, $client);
|
|
$this->_success($result['msg'], $result['data'], $result['code']);
|
|
}
|
|
$this->_error($result);
|
|
}
|
|
} |