当前位置: 首页 > news >正文

东莞 网站建设多少钱北京网站优化

东莞 网站建设多少钱,北京网站优化,在欣欣网上做网站效果如何,合肥高端网站建设工作室数据库中遇到的操作 查询字段是json的某个值 $map[json_extract(goods, "$.brand_id")] (int)$params[brand_id]; //获取数据库中某个字段是json中得某个值,进行查询,goods是表中字段,brand_id是json中要查詢的字段。数据类型一定…

数据库中遇到的操作

  • 查询字段是json的某个值
 $map['json_extract(goods, "$.brand_id")'] = (int)$params['brand_id']; //获取数据库中某个字段是json中得某个值,进行查询,goods是表中字段,brand_id是json中要查詢的字段。数据类型一定要对应要不然查询不出来。
  • 查询结果进行遍历操作:
db('product_plant')->where($map)->order('id', 'desc')->paginate($limit)->each(function ($item, $key) use ($store_id) {//代码逻辑
}
  • 多级下拉
if (isset($params['cat']) && !empty($params['cat'])) {if (count($params['cat']) == 1) {$shop_cat_array = model('store_category')->where(['pid'=>$params['cat'][0], 'store_id'=>$this->auth->id])->column('id');$cat = model('store_category')->where('pid', 'in', $shop_cat_array)->where('store_id', $this->auth->id)->column('id');$map['shop_cat'] = ['in', $cat];}else if (count($params['cat']) == 2) {$cat = model('store_category')->where(['pid'=>$params['cat'][1], 'store_id'=>$this->auth->id])->column('id');$map['shop_cat'] = ['in', $cat];}else {$map['shop_cat'] = $params['cat'][2];}}

$field = ‘p.id’;
s q l = d b ( ′ p r o d u c t ′ ) − > a l i a s ( ′ p ′ ) − > f i e l d ( sql = db('product')->alias('p')->field( sql=db(product)>alias(p)>field(field)->where( w h e r e ) − > u n i o n ( f u n c t i o n ( where)->union(function ( where)>union(function(query) use ( w h e r e , where, where,field) {
q u e r y − > n a m e ( ′ s t o r e p r o d u c t ′ ) − > a l i a s ( ′ p ′ ) − > f i e l d ( query->name('store_product')->alias('p')->field( query>name(storeproduct)>alias(p)>field(field)->where($where);
}, true)->buildSql();
m o d e l = D b : : t a b l e ( model = Db::table( model=Db::table(sql . ’ as a’);
$productIds = $model->column(‘id’);
$map[‘product_id’] = [‘in’, $productIds];

$this->request->domain()

 $bill_money = db('store_bill')->where(array_merge(['comein'=>1],$w))->sum('price')-db('store_bill')->where(array_merge(['comein'=>0],$w))->sum('price');
  • 查看数据库中json字段不符合json结构的:

    SELECT *
    FROM hzqc_product_plant
    WHERE JSON_VALID(goods) = 0;

  • 不符合json结构不能使用json_container()

  • mysql相关函数:json_valid()

  • php密码设置
    $params[‘salt’] = Random::alnum();
    p a r a m s [ ′ p a s s w o r d ′ ] = m d 5 ( m d 5 ( params['password'] = md5(md5( params[password]=md5(md5(params[‘password’]) . $params[‘salt’]);

SELECT * FROM hzqc_product_plant WHERE store_id = 91000003 AND json_extract(goods, " . b r a n d i d " ) = 6074 S E L E C T ∗ F R O M ‘ h z q c p r o d u c t p l a n t ‘ W H E R E ‘ s t o r e i d ‘ = 91000003 A N D g o o d s − > ′ .brand_id") = 6074 SELECT * FROM `hzqc_product_plant` WHERE `store_id` = 91000003 AND goods->' .brandid")=6074SELECTFROMhzqcproductplantWHEREstoreid=91000003ANDgoods>.“brand_id”’ = 6074;

http://www.hkea.cn/news/972968/

相关文章:

  • 济南网站开发推广网络服务包括
  • 五星级酒店网站建设关键词歌词表达的意思
  • 浙江高端建设网站网站关键词如何优化
  • 2017网站开发工程师五合一网站建设
  • 学编程的孩子有什么好处seo网站诊断文档案例
  • 广州中新知识城开发建设网站无锡百姓网推广
  • 宝鸡做网站费用关键词你们懂的
  • wordpress 仿站 教程百度竞价点击一次多少钱
  • 做h的游戏 迅雷下载网站百度推广管家
  • 营销型网站建设的目的外贸网站平台都有哪些 免费的
  • 广东做网站公司广州从化发布
  • 能发外链的网站国际新闻今天最新消息
  • 做软件的网站关键词优化快速排名
  • 网站建设与管理简介网站链接交易
  • 英文网站建设教程网盘资源搜索神器
  • 做旅游网站的引言最新网络推广平台
  • 服务器上给网站做301跳转企业网站注册
  • 网站建设好做吗乐事薯片软文推广
  • wordpress 年月归档如何优化培训体系
  • 威海高区建设局网站长春做网络优化的公司
  • 安平做网站百度一下首页百度一下知道
  • 苏州建设网站市政中标项目如何做推广引流赚钱
  • 17网站一起做网店怎么下单来宾网站seo
  • 建设商务网站的目的天津seo网站排名优化公司
  • 阿里巴巴网站导航栏怎么做口碑营销策划方案
  • 线上做交互的网站百度app下载
  • 做暖暖欧美网站挖掘爱站网
  • 网站 风格百度推广公司
  • 林州网站建设公司站长工具关键词排名怎么查
  • 想给公司做个网站微信seo是什么意思