新增可转售商品列表
This commit is contained in:
parent
6b8e395f30
commit
9cfc2d0757
@ -99,6 +99,7 @@ class CommunityRepository extends BaseRepository
|
||||
$config = systemConfig("community_app_switch");
|
||||
if (!isset($where['is_type']) && $config) $where['is_type'] = is_array($config) ? implode(',', $config) : $config;
|
||||
$where['is_del'] = 0;
|
||||
// print_r($where);
|
||||
$query = $this->dao->search($where)->when(in_array(self::COMMUNITY_TYPE_RESALE, explode(',', $where['is_type'])), function ($query) {
|
||||
$query->where('is_sale', 0);
|
||||
})->order('start DESC,Community.create_time DESC,community_id DESC');
|
||||
|
@ -2434,4 +2434,31 @@ class ProductRepository extends BaseRepository
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 可转售商品列表
|
||||
* @param
|
||||
* @param
|
||||
* @param
|
||||
* @return array
|
||||
*/
|
||||
public function communityProduct($where, $keyword, $page, $limit)
|
||||
{
|
||||
$merId = Db::name('store_service')->where('uid', $where['uid'])->where('status', 1)->value('mer_id', 0);
|
||||
unset($where['uid']);
|
||||
$query = $this->dao->search($merId, $where)->with(['merCateId.category', 'storeCategory', 'brand', 'attrValue']);
|
||||
$count = $query->count();
|
||||
$data = $query->page($page, $limit)->setOption('field', [])->field($this->filed)->select();
|
||||
$data->append(['us_status']);
|
||||
$list = hasMany(
|
||||
$data ,
|
||||
'mer_labels',
|
||||
ProductLabel::class,
|
||||
'product_label_id',
|
||||
'mer_labels',
|
||||
['status' => 1],
|
||||
'product_label_id,product_label_id id,label_name name'
|
||||
);
|
||||
return compact('count', 'list');
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -16,6 +16,7 @@ use app\common\model\system\merchant\Merchant;
|
||||
use app\common\repositories\community\CommunityRepository;
|
||||
use app\common\repositories\store\order\StoreOrderProductRepository;
|
||||
use app\common\repositories\store\order\StoreOrderRepository;
|
||||
use app\common\repositories\store\product\ProductRepository;
|
||||
use app\common\repositories\system\RelevanceRepository;
|
||||
use app\common\repositories\user\UserHistoryRepository;
|
||||
use app\common\repositories\user\UserRelationRepository;
|
||||
@ -438,6 +439,14 @@ class Community extends BaseController
|
||||
return app('json')->success($list);
|
||||
}
|
||||
|
||||
public function product()
|
||||
{
|
||||
[$page, $limit] = $this->getPage();
|
||||
$keyword = $this->request->param('keyword');
|
||||
$list = app()->make(ProductRepository::class)->communityProduct(['uid' => $this->request->uid()], $keyword, $page, $limit);
|
||||
return app('json')->success($list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 转售加购
|
||||
* @return mixed
|
||||
|
@ -404,6 +404,7 @@ Route::group('api/', function () {
|
||||
|
||||
Route::get('/focuslst', 'Community/focuslst');
|
||||
Route::get('/getOrderList', 'Community/getOrderList');
|
||||
Route::get('/product/lst', 'Community/product');
|
||||
Route::post('/addCart', 'Community/addCart');
|
||||
})->prefix('api.community.');
|
||||
//上传图片
|
||||
|
Loading…
x
Reference in New Issue
Block a user