diff --git a/app/admin/controller/nk/Products.php b/app/admin/controller/nk/Products.php index 218b4a5..b428165 100644 --- a/app/admin/controller/nk/Products.php +++ b/app/admin/controller/nk/Products.php @@ -156,6 +156,15 @@ class Products extends BaseController $id = isset($param['id']) ? $param['id'] : 0; $detail = Db::table('cms_agriculture_products')->where('id',$id)->find(); if (!empty($detail)) { + if($detail){ + $maturity = Db::table('cms_agriculture_products_traceability')->where('szxc_planting_type_id',$detail['szxc_planting_type_id'])->value('content'); + if($maturity){ + $maturity = json_decode($maturity,1); + }else{ + $maturity = ''; + } + $detail['maturity'] = $maturity; + } View::assign('detail', $detail); $szxc_planting_type = Db::table('fa_szxc_planting_type')->select(); View::assign('szxc_planting_type', $szxc_planting_type); diff --git a/app/admin/view/nk/farmers/edit.html b/app/admin/view/nk/farmers/edit.html index 329498b..9b97751 100644 --- a/app/admin/view/nk/farmers/edit.html +++ b/app/admin/view/nk/farmers/edit.html @@ -67,6 +67,8 @@ function gouguInit() { var form = layui.form, tool = layui.tool, tagpicker = layui.tagpicker,laydate = layui.laydate; var editor = layui.tinymce; + var lat = "{$detail.lat}"; + var lng = "{$detail.lng}"; var edit = editor.render({ selector: "#container_content", height: 500 @@ -99,6 +101,8 @@ created: function () { //可选项,地图被创建后回调 }, }); + $('.lng').text(lng); + $('.lat').text(lat); //监听提交 form.on('submit(webform)', function (data) { data.field.lng = $('.lng').text(); diff --git a/app/admin/view/nk/products/read.html b/app/admin/view/nk/products/read.html index 4381623..8df533e 100644 --- a/app/admin/view/nk/products/read.html +++ b/app/admin/view/nk/products/read.html @@ -40,6 +40,18 @@ + + 成熟周期 + + {volist name='detail.maturity' id='vo'} +

+ {$vo.name} + {$vo.zhouqi}周 +

+ {/volist} + + + {/block} diff --git a/app/admin/view/nk/vegetable/edit.html b/app/admin/view/nk/vegetable/edit.html index d228395..0c2bb9a 100644 --- a/app/admin/view/nk/vegetable/edit.html +++ b/app/admin/view/nk/vegetable/edit.html @@ -67,6 +67,8 @@ function gouguInit() { var form = layui.form, tool = layui.tool, tagpicker = layui.tagpicker,laydate = layui.laydate; var editor = layui.tinymce; + var lat = "{$detail.lat}"; + var lng = "{$detail.lng}"; var edit = editor.render({ selector: "#container_content", height: 500 @@ -99,6 +101,8 @@ created: function () { //可选项,地图被创建后回调 }, }); + $('.lng').text(lng); + $('.lat').text(lat); //监听提交 form.on('submit(webform)', function (data) { data.field.lng = $('.lng').text(); diff --git a/app/api/controller/Statistics.php b/app/api/controller/Statistics.php index 25e8ef9..7db751d 100644 --- a/app/api/controller/Statistics.php +++ b/app/api/controller/Statistics.php @@ -713,8 +713,14 @@ class Statistics extends BaseController // 录入商户 $return['shanghu'] = Db::connect('shop')->table('eb_merchant')->alias('a')->join('eb_merchant_address b','a.mer_id = b.mer_id')->where($where)->where($map)->count(); // 总订单 - $return['total_order'] = Db::connect('shop')->table('eb_product_order_log')->where($where)->where('status',1)->count(); -// 商品销量前十 + $return['total_order'] = Db::connect('shop')->table('eb_product_order_log')->where('status',1)->count(); +// 镇订单 + $z_order = Db::connect('shop')->table('eb_product_order_log')->where($where)->where('status',1)->count(); +// 镇分佣 + $return['fenyong'] = 0; + //总市场流量 + $return['liuliang'] = bcmul(bcdiv($z_order,$return['total_order'],2),100); + // 商品销量前十 $return['data'] = Db::connect('shop')->table('eb_store_product') ->alias('a') ->join('eb_product_order_log b','a.product_id = b.product_id') @@ -725,6 +731,7 @@ class Statistics extends BaseController ->group('a.product_id') ->order('value desc') ->select(); + $this->apiSuccess('获取成功',$return); } @@ -927,5 +934,118 @@ class Statistics extends BaseController } + //养殖户数 + public function get_num22($area_id=0,$street_id=0,$village_id=0){ + $where = []; + if ($area_id){ + $where[] = ['area_id', '=', $area_id]; + } + if ($street_id){ + $where[] = ['street_id', '=', $street_id]; + } + if ($village_id){ + $where[] = ['village_id', '=', $village_id]; + } + + $return = [ + ['value'=>50,'name'=>'养鸡'], + ['value'=>48,'name'=>'养鸭'], + ['value'=>28,'name'=>'养鹅'], + ['value'=>10,'name'=>'养羊'], + ['value'=>8,'name'=>'养虾'], + ['value'=>30,'name'=>'养鱼'], + ]; + $this->apiSuccess('获取成功',$return); + } + + //养殖户销量分析 + public function get_num23($area_id=0,$street_id=0,$village_id=0){ + $where = []; + if ($area_id){ + $where[] = ['area_id', '=', $area_id]; + } + if ($street_id){ + $where[] = ['street_id', '=', $street_id]; + } + if ($village_id){ + $where[] = ['village_id', '=', $village_id]; + } + + $return = [ + [ + 'name'=>'鸡', + 'data'=> + [['month'=>'1月','value'=>'661'], + ['month'=>'2月','value'=>'356'], + ['month'=>'3月','value'=>'415'], + ['month'=>'4月','value'=>'258'], + ['month'=>'5月','value'=>'779'], + ['month'=>'6月','value'=>'1465'], + ['month'=>'7月','value'=>'668'], + ['month'=>'8月','value'=>'571'], + ['month'=>'9月','value'=>'498'], + ['month'=>'10月','value'=>'587'], + ['month'=>'11月','value'=>'881'], + ['month'=>'12月','value'=>'1008']], + ], + [ + 'name'=>'鸭', + 'data'=> + [['month'=>'1月','value'=>'123'], + ['month'=>'2月','value'=>'456'], + ['month'=>'3月','value'=>'789'], + ['month'=>'4月','value'=>'147'], + ['month'=>'5月','value'=>'258'], + ['month'=>'6月','value'=>'369'], + ['month'=>'7月','value'=>'159'], + ['month'=>'8月','value'=>'267'], + ['month'=>'9月','value'=>'367'], + ['month'=>'10月','value'=>'541'], + ['month'=>'11月','value'=>'354'], + ['month'=>'12月','value'=>'897']], + ], + [ + 'name'=>'鹅', + 'data'=> + [['month'=>'1月','value'=>'245'], + ['month'=>'2月','value'=>'245'], + ['month'=>'3月','value'=>'411'], + ['month'=>'4月','value'=>'246'], + ['month'=>'5月','value'=>'631'], + ['month'=>'6月','value'=>'1234'], + ['month'=>'7月','value'=>'546'], + ['month'=>'8月','value'=>'246'], + ['month'=>'9月','value'=>'356'], + ['month'=>'10月','value'=>'466'], + ['month'=>'11月','value'=>'744'], + ['month'=>'12月','value'=>'998']], + ] + ]; + $this->apiSuccess('获取成功',$return); + } + + //养殖户产量分析 + public function get_num24($area_id=0,$street_id=0,$village_id=0){ + $where = []; + if ($area_id){ + $where[] = ['area_id', '=', $area_id]; + } + if ($street_id){ + $where[] = ['street_id', '=', $street_id]; + } + if ($village_id){ + $where[] = ['village_id', '=', $village_id]; + } + + $return = [ + ['name' => '鸡','value'=>40], + ['name' => '鸭','value'=>50], + ['name' => '鹅','value'=>10], + ]; + $this->apiSuccess('获取成功',$return); + } + + + }