调整商户商品分类列表查询
This commit is contained in:
parent
31c1a05d9b
commit
8c5a87a337
@ -14,6 +14,7 @@
|
|||||||
namespace app\common\repositories\system\merchant;
|
namespace app\common\repositories\system\merchant;
|
||||||
|
|
||||||
|
|
||||||
|
use app\common\dao\store\StoreCategoryDao;
|
||||||
use app\common\dao\system\merchant\MerchantDao;
|
use app\common\dao\system\merchant\MerchantDao;
|
||||||
use app\common\model\store\order\StoreOrder;
|
use app\common\model\store\order\StoreOrder;
|
||||||
use app\common\model\store\product\ProductReply;
|
use app\common\model\store\product\ProductReply;
|
||||||
@ -381,12 +382,17 @@ class MerchantRepository extends BaseRepository
|
|||||||
/**
|
/**
|
||||||
* @Author:Qinii
|
* @Author:Qinii
|
||||||
* @Date: 2020/5/30
|
* @Date: 2020/5/30
|
||||||
* @param int $id
|
* @param int $merId
|
||||||
|
* @param int $pid
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function categoryList(int $id)
|
public function categoryList(int $merId, int $pid = 0)
|
||||||
{
|
{
|
||||||
return app()->make(StoreCategoryRepository::class)->getApiFormatList($id, 1);
|
if ($pid == 0) {
|
||||||
|
return app()->make(StoreCategoryRepository::class)->getApiFormatList($merId, 1);
|
||||||
|
} else {
|
||||||
|
return app()->make(StoreCategoryDao::class)->children($pid, $merId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function wxQrcode($merId)
|
public function wxQrcode($merId)
|
||||||
|
@ -698,6 +698,8 @@ class UserRepository extends BaseRepository
|
|||||||
public function registr(string $phone, ?string $pwd, $user_type = 'h5')
|
public function registr(string $phone, ?string $pwd, $user_type = 'h5')
|
||||||
{
|
{
|
||||||
$pwd = $pwd ? $this->encodePassword($pwd) : $this->encodePassword($this->dao->defaultPwd());
|
$pwd = $pwd ? $this->encodePassword($pwd) : $this->encodePassword($this->dao->defaultPwd());
|
||||||
|
$ip = app('request')->ip();
|
||||||
|
$code = Cache::get('promote_'.$ip);
|
||||||
$data = [
|
$data = [
|
||||||
'account' => $phone,
|
'account' => $phone,
|
||||||
'pwd' => $pwd,
|
'pwd' => $pwd,
|
||||||
@ -706,6 +708,14 @@ class UserRepository extends BaseRepository
|
|||||||
'phone' => $phone,
|
'phone' => $phone,
|
||||||
'last_ip' => app('request')->ip()
|
'last_ip' => app('request')->ip()
|
||||||
];
|
];
|
||||||
|
if ($code) {
|
||||||
|
$data['promotion_code'] = $code;
|
||||||
|
$shop = explode('shop_', $code);
|
||||||
|
if (count($shop) == 2) {
|
||||||
|
$data['spread_uid'] = $shop[1];
|
||||||
|
}
|
||||||
|
Cache::delete('promote_' . $ip);
|
||||||
|
}
|
||||||
return $this->create($user_type, $data);
|
return $this->create($user_type, $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -663,4 +663,14 @@ class Common extends BaseController
|
|||||||
return app('json')->success($select);
|
return app('json')->success($select);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 推广写入
|
||||||
|
*/
|
||||||
|
public function promoteWriting()
|
||||||
|
{
|
||||||
|
$code = $this->request->param('code');
|
||||||
|
Cache::set('promote_' . app('request')->ip(), $code, 86400);
|
||||||
|
return app('json')->success();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -101,9 +101,10 @@ class Merchant extends BaseController
|
|||||||
*/
|
*/
|
||||||
public function categoryList($id)
|
public function categoryList($id)
|
||||||
{
|
{
|
||||||
|
$pid = $this->request->get('pid', 0);
|
||||||
if(!$this->repository->merExists((int)$id))
|
if(!$this->repository->merExists((int)$id))
|
||||||
return app('json')->fail('店铺已打烊');
|
return app('json')->fail('店铺已打烊');
|
||||||
return app('json')->success($this->repository->categoryList($id));
|
return app('json')->success($this->repository->categoryList($id, $pid));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function qrcode($id)
|
public function qrcode($id)
|
||||||
|
@ -22,6 +22,7 @@ use think\facade\Route;
|
|||||||
Route::group('api/', function () {
|
Route::group('api/', function () {
|
||||||
Route::any('test', 'api.Auth/test');
|
Route::any('test', 'api.Auth/test');
|
||||||
Route::any('applet', 'api.Common/applet');
|
Route::any('applet', 'api.Common/applet');
|
||||||
|
Route::any('promote_writing', 'api.Common/promoteWriting');
|
||||||
//强制登录
|
//强制登录
|
||||||
Route::group(function () {
|
Route::group(function () {
|
||||||
Route::group('v2', function () {
|
Route::group('v2', function () {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user