Merge branch 'v5.0.0dev' of https://gitee.com/ZhongBangKeJi/CRMEB into v5.0.0dev

This commit is contained in:
From-wh 2023-03-20 16:06:26 +08:00
commit defc7ea505
24 changed files with 53 additions and 36 deletions

View File

@ -8,7 +8,7 @@
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
declare (strict_types = 1);
declare (strict_types=1);
namespace app\dao\activity\advance;
@ -37,13 +37,17 @@ class StoreAdvanceDao extends BaseDao
* @param int $page
* @param int $limit
* @return array
* @throws \ReflectionException
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author 吴汐
* @email 442384644@qq.com
* @date 2023/03/20
*/
public function getList(array $where, int $page = 0, int $limit = 0)
{
return $this->search($where)
return $this->search($where, false)
->when($where['time_type'], function ($query) use ($where) {
if ($where['time_type'] == 1) $query->whereTime('start_time', '>', time());
if ($where['time_type'] == 2) $query->whereTime('start_time', '<=', time())->whereTime('stop_time', '>=', time());
@ -57,10 +61,11 @@ class StoreAdvanceDao extends BaseDao
/**
* @param array $where
* @return int
* @throws \ReflectionException
*/
public function getCount(array $where)
{
return $this->search($where)
return $this->search($where, false)
->when($where['time_type'], function ($query) use ($where) {
if ($where['time_type'] == 1) $query->whereTime('start_time', '>', time());
if ($where['time_type'] == 2) $query->whereTime('start_time', '<=', time())->whereTime('stop_time', '>=', time());

View File

@ -44,7 +44,7 @@ class StoreBargainDao extends BaseDao
*/
public function getList(array $where, int $page = 0, int $limit = 0)
{
return $this->search($where)->where('is_del', 0)
return $this->search($where, false)->where('is_del', 0)
->when(isset($where['start_status']) && $where['start_status'] !== '', function ($query) use ($where) {
$time = time();
switch ($where['start_status']) {
@ -135,7 +135,7 @@ class StoreBargainDao extends BaseDao
*/
public function DiyBargainList(array $where, int $page, int $limit)
{
return $this->search($where)
return $this->search($where, false)
->when(isset($where['sid']) && $where['sid'], function ($query) use ($where) {
$query->whereIn('id', function ($query) use ($where) {
$query->name('store_product_cate')->where('cate_id', $where['sid'])->field('product_id')->select();
@ -165,7 +165,7 @@ class StoreBargainDao extends BaseDao
*/
public function getHomeList(array $where, int $page, int $limit)
{
return $this->search($where)
return $this->search($where, false)
->when(isset($where['sid']) && $where['sid'], function ($query) use ($where) {
$query->whereIn('id', function ($query) use ($where) {
$query->name('store_product_cate')->where('cate_id', $where['sid'])->field('product_id')->select();
@ -215,7 +215,7 @@ class StoreBargainDao extends BaseDao
*/
public function getCount(array $where)
{
return $this->search($where)
return $this->search($where, false)
->when(isset($where['sid']) && $where['sid'], function ($query) use ($where) {
$query->whereIn('product_id', function ($query) use ($where) {
$query->name('store_product_cate')->where('cate_id', $where['sid'])->field('product_id')->select();

View File

@ -66,6 +66,7 @@ class StoreCombinationDao extends BaseDao
* 获取指定条件下的条数
* @param array $where
* @return int
* @throws \ReflectionException
*/
public function count(array $where = []): int
{
@ -147,6 +148,7 @@ class StoreCombinationDao extends BaseDao
* @param array $ids ids 为空返回所有
* @param array $field
* @return array
* @throws \ReflectionException
*/
public function getPinkIdsArray(array $ids = [], array $field = [])
{
@ -172,6 +174,7 @@ class StoreCombinationDao extends BaseDao
* 条件获取数量
* @param array $where
* @return int
* @throws \ReflectionException
*/
public function getCount(array $where)
{

View File

@ -54,7 +54,7 @@ class StorePinkDao extends BaseDao
*/
public function getList(array $where, int $page = 0, int $limit = 0)
{
return $this->search($where)->when($where['k_id'] != 0, function ($query) use ($where) {
return $this->search($where, false)->when($where['k_id'] != 0, function ($query) use ($where) {
$query->whereOr('id', $where['k_id']);
})->with('getProduct')->when($page != 0, function ($query) use ($page, $limit) {
$query->page($page, $limit);

View File

@ -308,13 +308,11 @@ class StoreCouponIssueDao extends BaseDao
*/
public function getTodayCoupon($uid)
{
// return $this->getModel()->where('receive_type', 1)->where('is_del', 0)->whereDay('add_time')->select()->toArray();
return $this->getModel()->where('status', 1)
->where('is_del', 0)
->where('remain_count > 0 OR is_permanent = 1')
->where(function ($query) {
$query->where('receive_type', 1)->whereOr('receive_type', 4);
// $query->where('receive_type', 1);
})->where(function ($query) {
$query->where(function ($query) {
$query->where('start_time', '<', time())->where('end_time', '>', time());

View File

@ -8,7 +8,7 @@
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
declare (strict_types = 1);
declare (strict_types=1);
namespace app\dao\activity\coupon;
@ -145,7 +145,7 @@ class StoreCouponUserDao extends BaseDao
*/
public function getCouponListByOrder(array $where, $order, int $page = 0, int $limit = 0)
{
return $this->search($where)->with('issue')->when($page > 0 && $limit > 0, function ($qeury) use ($page, $limit) {
return $this->search($where, false)->with('issue')->when($page > 0 && $limit > 0, function ($qeury) use ($page, $limit) {
$qeury->page($page, $limit);
})->when($order != '', function ($query) use ($order) {
$query->order($order);
@ -172,7 +172,7 @@ class StoreCouponUserDao extends BaseDao
*/
public function memberCouponUserGroupBymonth(array $where)
{
return $this->search($where)
return $this->search($where, false)
->whereMonth('add_time')
->whereIn('cid', $where['couponIds'])
->field('count(id) as num,FROM_UNIXTIME(add_time, \'%Y-%m\') as time')

View File

@ -54,7 +54,7 @@ class StoreIntegralDao extends BaseDao
*/
public function getList(array $where, int $page = 0, int $limit = 0, string $field = '*')
{
return $this->search($where)->where('is_del', 0)
return $this->search($where, false)->where('is_del', 0)
->when(isset($where['integral_time']) && $where['integral_time'] !== '', function ($query) use ($where) {
list($startTime, $endTime) = explode('-', $where['integral_time']);
$query->where('add_time', '>', strtotime($startTime))

View File

@ -31,9 +31,11 @@ class LiveGoodsDao extends BaseDao
/**
* @param array $where
* @param string $field
* @param array $with
* @param int $page
* @param int $limit
* @return array
* @throws \ReflectionException
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException

View File

@ -46,7 +46,7 @@ class AgentLevelDao extends BaseDao
*/
public function getList(array $where = [], string $field = '*', array $with = [], int $page = 0, int $limit = 0, $grade = 0)
{
return $this->search($where)->when($grade, function ($query) use ($grade) {
return $this->search($where, false)->when($grade, function ($query) use ($grade) {
$query->where('grade', '>=', $grade);
})->field($field)->when($with, function ($query) use ($with) {
$query->with($with);

View File

@ -41,7 +41,7 @@ class DeliveryServiceDao extends BaseDao
*/
public function getServiceList(array $where, int $page, int $limit)
{
return $this->search($where)->when($page && $limit, function ($query) use ($page, $limit) {
return $this->search($where, false)->when($page && $limit, function ($query) use ($page, $limit) {
$query->page($page, $limit);
})->when(isset($where['noId']), function ($query) use ($where) {
$query->where('id', '<>', $where['noId']);

View File

@ -59,7 +59,7 @@ class StoreOrderStoreOrderStatusDao extends BaseDao
* @param array $where
* @return \crmeb\basic\BaseModel|mixed|\think\Model
*/
protected function search(array $where = [])
public function search(array $where = [], bool $search = false)
{
return $this->getModel()->when(isset($where['paid']), function ($query) use ($where) {
$query->where($this->alias . '.paid', $where['paid']);

View File

@ -39,7 +39,7 @@ class StoreProductDao extends BaseDao
*/
public function getCount(array $where)
{
return $this->search($where)->when(isset($where['sid']) && $where['sid'], function ($query) use ($where) {
return $this->search($where, false)->when(isset($where['sid']) && $where['sid'], function ($query) use ($where) {
$query->whereIn('id', function ($query) use ($where) {
$query->name('store_product_cate')->where('cate_id', $where['sid'])->field('product_id')->select();
});
@ -112,7 +112,7 @@ class StoreProductDao extends BaseDao
public function getSearchList(array $where, int $page = 0, int $limit = 0, array $field = ['*'], array $with = ['couponId', 'description'])
{
if (isset($where['star'])) $with[] = 'star';
return $this->search($where)->with($with)->when($page != 0 && $limit != 0, function ($query) use ($page, $limit) {
return $this->search($where, false)->with($with)->when($page != 0 && $limit != 0, function ($query) use ($page, $limit) {
$query->page($page, $limit);
})->when(isset($where['sid']) && $where['sid'], function ($query) use ($where) {
$query->whereIn('id', function ($query) use ($where) {

View File

@ -25,7 +25,9 @@ class StoreServiceAuxiliaryDao extends AuxiliaryDao
/**
* 搜索
* @param array $where
* @param bool $search
* @return \crmeb\basic\BaseModel|mixed|\think\Model
* @throws \ReflectionException
*/
public function search(array $where = [], bool $search = false)
{

View File

@ -57,7 +57,7 @@ class StoreServiceDao extends BaseDao
*/
public function getServiceList(array $where, int $page, int $limit)
{
return $this->search($where)->with('user')->when($page && $limit, function ($query) use ($page, $limit) {
return $this->search($where, false)->with('user')->when($page && $limit, function ($query) use ($page, $limit) {
$query->page($page, $limit);
})->when(isset($where['noId']), function ($query) use ($where) {
$query->whereNotIn('uid', $where['noId']);

View File

@ -91,6 +91,7 @@ class SystemConfigDao extends BaseDao
* 获取上传配置中的上传类型
* @param string $configName
* @return array
* @throws \ReflectionException
*/
public function getUploadTypeList(string $configName)
{

View File

@ -66,7 +66,7 @@ class CapitalFlowDao extends BaseDao
$timeUnix = "%Y-%m";
break;
}
$model = $this->search($where)
$model = $this->search($where, false)
->when(isset($where['type']) && $where['type'] !== '', function ($query) use ($where, $timeUnix) {
$query->field("FROM_UNIXTIME(add_time,'$timeUnix') as day,sum(if(price >= 0,price,0)) as income_price,sum(if(price < 0,price,0)) as exp_price,add_time");
$query->group("FROM_UNIXTIME(add_time, '$timeUnix')");

View File

@ -242,7 +242,7 @@ class UserBillDao extends BaseDao
*/
public function getWhereSumField(array $where, string $field)
{
return $this->search($where)
return $this->search($where, false)
->when(isset($where['timeKey']), function ($query) use ($where) {
$query->whereBetweenTime('add_time', $where['timeKey']['start_time'], $where['timeKey']['end_time']);
})
@ -257,7 +257,7 @@ class UserBillDao extends BaseDao
*/
public function getGroupField(array $where, string $field, string $group)
{
return $this->search($where)
return $this->search($where, false)
->when(isset($where['timeKey']), function ($query) use ($where, $field, $group) {
$query->whereBetweenTime('add_time', $where['timeKey']['start_time'], $where['timeKey']['end_time']);
$timeUinx = "%H";

View File

@ -81,7 +81,7 @@ class UserExtractDao extends BaseDao
*/
public function getWhereSumField(array $where, string $field)
{
return $this->search($where)
return $this->search($where, false)
->when(isset($where['timeKey']), function ($query) use ($where) {
$query->whereBetweenTime('add_time', $where['timeKey']['start_time'], $where['timeKey']['end_time']);
})
@ -96,7 +96,7 @@ class UserExtractDao extends BaseDao
*/
public function getGroupField(array $where, string $field, string $group)
{
return $this->search($where)
return $this->search($where, false)
->when(isset($where['timeKey']), function ($query) use ($where, $field, $group) {
$query->whereBetweenTime('add_time', $where['timeKey']['start_time'], $where['timeKey']['end_time']);
$timeUinx = "%H";

View File

@ -74,7 +74,7 @@ class UserMoneyDao extends BaseDao
*/
public function getWhereSumField(array $where, string $field)
{
return $this->search($where)
return $this->search($where, false)
->when(isset($where['timeKey']), function ($query) use ($where) {
$query->whereBetweenTime('add_time', $where['timeKey']['start_time'], $where['timeKey']['end_time']);
})
@ -93,7 +93,7 @@ class UserMoneyDao extends BaseDao
*/
public function getGroupField(array $where, string $field, string $group)
{
return $this->search($where)
return $this->search($where, false)
->when(isset($where['timeKey']), function ($query) use ($where, $field, $group) {
$query->whereBetweenTime('add_time', $where['timeKey']['start_time'], $where['timeKey']['end_time']);
if ($where['timeKey']['days'] == 1) {

View File

@ -57,7 +57,7 @@ class UserRechargeDao extends BaseDao
*/
public function getWhereSumField(array $where, string $field)
{
return $this->search($where)
return $this->search($where, false)
->when(isset($where['timeKey']), function ($query) use ($where) {
$query->whereBetweenTime('pay_time', $where['timeKey']['start_time'], $where['timeKey']['end_time']);
})
@ -72,7 +72,7 @@ class UserRechargeDao extends BaseDao
*/
public function getGroupField(array $where, string $field, string $group)
{
return $this->search($where)
return $this->search($where, false)
->when(isset($where['timeKey']), function ($query) use ($where, $field, $group) {
$query->whereBetweenTime('pay_time', $where['timeKey']['start_time'], $where['timeKey']['end_time']);
$timeUinx = "%H";

View File

@ -74,7 +74,7 @@ class WechatReplyKeyDao extends BaseDao
* @param bool $group
* @return \crmeb\basic\BaseModel|mixed|Model
*/
protected function search(array $where = [])
public function search(array $where = [], bool $search = false)
{
return $this->getModel()->when(isset($where['key']) && $where['key'], function ($query) use ($where) {
$query->where($this->joinAlis . '.keys', 'LIKE', "%$where[key]%");

View File

@ -57,7 +57,7 @@ class StoreProductRelationServices extends BaseServices
*/
public function getUserCollectCount(int $uid)
{
return $this->dao->count(['uid' => $uid, 'tye' => 'collect']);
return $this->dao->count(['uid' => $uid, 'type' => 'collect']);
}
/**

View File

@ -41,7 +41,7 @@
<!-- #ifdef APP-PLUS || MP -->
<view class="" :style="'width:100%;' + 'height:'+sysHeight"></view>
<!-- #endif -->
<productConSwiper :imgUrls="imgUrls"></productConSwiper>
<productConSwiper :imgUrls="imgUrls" @showSwiperImg="showSwiperImg"></productConSwiper>
<view class='wrapper'>
<view class='share acea-row row-between row-bottom'>
<view class='money font-color'>
@ -261,6 +261,7 @@
<product-window :attr='attribute' :limitNum='1' @myevent="onMyEvent" @ChangeAttr="ChangeAttr"
@ChangeCartNum="ChangeCartNum" @iptCartNum="iptCartNum" @attrVal="attrVal" @getImg="showImg">
</product-window>
<swiperPrevie ref="cusSwiperImg" :list="storeInfo.images"></swiperPrevie>
<cus-previewImg ref="cusPreviewImg" :list="skuArr" @changeSwitch="changeSwitch"
@shareFriend="listenerActionSheet" />
<kefuIcon :ids='storeInfo.product_id' :routineContact='routineContact'></kefuIcon>
@ -281,6 +282,7 @@
import authorize from '@/components/Authorize';
// #endif
import productConSwiper from '@/components/productConSwiper/index.vue'
import swiperPrevie from "@/components/cusPreviewImg/swiperPrevie.vue";
import {
toLogin
} from '@/libs/login.js';
@ -336,7 +338,8 @@
cusPreviewImg,
parser,
menuIcon,
homeList
homeList,
swiperPrevie
},
computed: mapGetters({
'isLogin': 'isLogin',
@ -518,6 +521,9 @@
moreNav() {
this.currentPage = !this.currentPage
},
showSwiperImg(index) {
this.$refs.cusSwiperImg.open(index);
},
qrR(res) {
// #ifdef H5
if (!this.$wechat.isWeixin() || this.shareQrcode != '1') {
@ -601,7 +607,7 @@
combinationDetail() {
var that = this;
var data = that.id;
getCombinationDetail(data).then((res)=> {
getCombinationDetail(data).then((res) => {
that.dataShow = 1;
uni.setNavigationBarTitle({
title: res.data.storeInfo.title.substring(0, 16)
@ -664,7 +670,7 @@
that.infoScroll();
}, 500);
}).catch(function(err) {
}).catch(function(err) {
console.log(err)
that.$util.Tips({
title: err

View File

@ -359,7 +359,7 @@
hover-class='none' :url="'/pages/goods/goods_logistics/index?orderId='+ orderInfo.order_id">
{{$t(`查看物流`)}}
</navigator>
<view class='bnt bg-color' v-if="orderInfo.type == 3 && orderInfo.refund_type == 0"
<view class='bnt bg-color' v-if="orderInfo.type == 3 && orderInfo.refund_type == 0 && orderInfo.paid"
@tap='goJoinPink'>
{{$t(`查看拼团`)}}
</view>