Commit d82c7217 by lizhilin

更新

parent 2d12a6d2
...@@ -32,10 +32,7 @@ public function __construct($title = '', $goods_id = 0) ...@@ -32,10 +32,7 @@ public function __construct($title = '', $goods_id = 0)
parent::__construct($title); parent::__construct($title);
$this->title = $title; $this->title = $title;
} }
/**
* @return string
*/
//protected $title = '<i class="feather icon-stop-circle"> 增加库存 </i>';
/** /**
* 按钮文本 * 按钮文本
* *
...@@ -82,7 +79,6 @@ public function render() ...@@ -82,7 +79,6 @@ public function render()
$html = ''; $html = '';
foreach ($dataArr as $kk => $vv) { foreach ($dataArr as $kk => $vv) {
$html .= '<tr>'; $html .= '<tr>';
$html .= '<input type="hidden" name="sskuid[]" value="' . $vv['id'] . '">'; $html .= '<input type="hidden" name="sskuid[]" value="' . $vv['id'] . '">';
$html .= '<input type="hidden" name="goods_id" value="' . $this->goods_id . '">'; $html .= '<input type="hidden" name="goods_id" value="' . $this->goods_id . '">';
$html .= '<input type="hidden" name="mgs_id" value="' . $mgs_id . '">'; $html .= '<input type="hidden" name="mgs_id" value="' . $mgs_id . '">';
...@@ -103,7 +99,10 @@ public function render() ...@@ -103,7 +99,10 @@ public function render()
<<<js <<<js
$(document).ready(function () { $(document).ready(function () {
console.log('{$html}'); console.log('{$html}');
var htmlValue = '{$html}';
if(htmlValue.length > 0) {
$("#tabletr2").html('"+ $html +"'); $("#tabletr2").html('"+ $html +"');
}
}); });
js js
); );
......
...@@ -23,7 +23,8 @@ protected function grid() ...@@ -23,7 +23,8 @@ protected function grid()
return Grid::make(Article::with(['cat']), function (Grid $grid) { return Grid::make(Article::with(['cat']), function (Grid $grid) {
$grid->model()->orderBy('created_at', 'DESC'); $grid->model()->orderBy('created_at', 'DESC');
$grid->column('id')->sortable(); $grid->column('id')->sortable();
$grid->column('title'); $grid->column('title')->limit(20);
$grid->column('brief', '副标题')->limit(20);
$grid->column('cat.title', '分类名称'); $grid->column('cat.title', '分类名称');
$grid->column('content')->if(function ($column) { $grid->column('content')->if(function ($column) {
return $column->getValue(); return $column->getValue();
......
...@@ -91,6 +91,10 @@ protected function form() ...@@ -91,6 +91,10 @@ protected function form()
$form->select('city_id', '城市'); $form->select('city_id', '城市');
$form->hasMany('store_desc', '添加门店', function (\Dcat\Admin\Widgets\Form $forms) { $form->hasMany('store_desc', '添加门店', function (\Dcat\Admin\Widgets\Form $forms) {
$forms->text('title', '门店名称')->required(); $forms->text('title', '门店名称')->required();
$forms->select('provinceId', '省份')->options(City::where('parent_id', 0)->get()->pluck('name', 'city_id'))->rules('required')->load('cityId', '/city');
$forms->select('cityId', '城市');
$forms->text('contacts', '联系人');
$forms->text('phone', '手机号');
$forms->text('lat_lng', '经纬度')->help('<a href="https://lbs.amap.com/tools/picker" target="_blank">点击获取高德地图坐标</a>'); $forms->text('lat_lng', '经纬度')->help('<a href="https://lbs.amap.com/tools/picker" target="_blank">点击获取高德地图坐标</a>');
$forms->text('address', '详细地址'); $forms->text('address', '详细地址');
$forms->text('distance', '配送范围(Km)'); $forms->text('distance', '配送范围(Km)');
......
...@@ -22,11 +22,7 @@ ...@@ -22,11 +22,7 @@
class MerchantGoodsStoreController extends AdminController class MerchantGoodsStoreController extends AdminController
{ {
// public function index(Content $content)
// {
// echo 11;
// die;
// }
/** /**
* Make a grid builder. * Make a grid builder.
* *
...@@ -63,12 +59,8 @@ protected function grid() ...@@ -63,12 +59,8 @@ protected function grid()
}); });
$grid->actions(function (Grid\Displayers\Actions $actions) { $grid->actions(function (Grid\Displayers\Actions $actions) {
//当前status
//$status = $actions->row->status;
//if ($status == 0) {
$actions->append(new MerchantAddStore('增加库存', $actions->row->goods_id)); $actions->append(new MerchantAddStore('增加库存', $actions->row->goods_id));
$actions->append(new MerchantSubStore('减少库存', $actions->row->goods_id)); $actions->append(new MerchantSubStore('减少库存', $actions->row->goods_id));
//}
}); });
}); });
} }
......
...@@ -14,6 +14,8 @@ public function __construct($containerSelector = null, $options = []) ...@@ -14,6 +14,8 @@ public function __construct($containerSelector = null, $options = [])
$this->setUpOptions(); $this->setUpOptions();
} }
/** /**
* 初始化图表配置 * 初始化图表配置
*/ */
...@@ -28,7 +30,7 @@ protected function setUpOptions() ...@@ -28,7 +30,7 @@ protected function setUpOptions()
'chart' => [ 'chart' => [
'type' => 'bar', 'type' => 'bar',
'height' => 430, 'height' => 430,
'barWidth' => '1' 'barWidth' => '1',
], ],
'plotOptions' => [ 'plotOptions' => [
'bar' => [ 'bar' => [
...@@ -85,10 +87,6 @@ protected function buildData() ...@@ -85,10 +87,6 @@ protected function buildData()
*/ */
public function withData(array $data) public function withData(array $data)
{ {
//$data[0] = array_merge($data[0], ['itemStyle' => ['barWidth' => '1%']]);
// echo "<pre>";
// print_r($data);
// die;
return $this->option('series', $data); return $this->option('series', $data);
} }
......
...@@ -13,6 +13,6 @@ class Article extends Model ...@@ -13,6 +13,6 @@ class Article extends Model
public function cat() public function cat()
{ {
return $this->belongsTo(category::class, 'cat_id'); return $this->belongsTo(Category::class, 'cat_id');
} }
} }
...@@ -42,7 +42,7 @@ public function merchant() ...@@ -42,7 +42,7 @@ public function merchant()
* status 订单状态 * status 订单状态
* merchant_id 商户ID * merchant_id 商户ID
*/ */
public static function getNumDayData2($started = '', $ended = '', $status = [], $merchant_id = 0) public static function getNumData($started = '', $ended = '', $status = [], $merchant_id = 0)
{ {
$where = []; $where = [];
$sqlObj = new self(); $sqlObj = new self();
......
...@@ -11,5 +11,5 @@ class Store extends Model ...@@ -11,5 +11,5 @@ class Store extends Model
use HasDateTimeFormatter; use HasDateTimeFormatter;
protected $table = 'store'; protected $table = 'store';
protected $fillable = ['title', 'merchant_id', 'lat_lng']; protected $fillable = ['title', 'merchant_id', 'provinceId', 'cityId', 'contacts', 'phone', 'lat_lng', 'address', 'distance', 'business_license'];
} }
...@@ -55,7 +55,7 @@ public function handle(Request $request) ...@@ -55,7 +55,7 @@ public function handle(Request $request)
$started = date("Y-m-01"); $started = date("Y-m-01");
$ended = date("Y-m-t"); $ended = date("Y-m-t");
$order_status = [3, 4]; $order_status = [3, 4];
$count = OrderInfoModel::getNumDayData($started, $ended, $order_status, Admin::user()->id); $count = OrderInfoModel::getNumData($started, $ended, $order_status, Admin::user()->id);
// 卡片内容 // 卡片内容
$this->withContent($count); $this->withContent($count);
......
...@@ -50,7 +50,7 @@ public function handle(Request $request) ...@@ -50,7 +50,7 @@ public function handle(Request $request)
//本月 //本月
$started = date("Y-m-01"); $started = date("Y-m-01");
$ended = date("Y-m-t"); $ended = date("Y-m-t");
$count = OrderInfoModel::getNumDayData($started, $ended, [2], Admin::user()->id); $count = OrderInfoModel::getNumData($started, $ended, [2], Admin::user()->id);
// 卡片内容 // 卡片内容
$this->withContent($count); $this->withContent($count);
// 图表数据 // 图表数据
......
...@@ -54,7 +54,7 @@ public function handle(Request $request) ...@@ -54,7 +54,7 @@ public function handle(Request $request)
$started = date("Y-m-01"); $started = date("Y-m-01");
$ended = date("Y-m-t"); $ended = date("Y-m-t");
$order_status = [2]; $order_status = [2];
$count = OrderInfoModel::getNumDayData($started, $ended, $order_status, Admin::user()->id); $count = OrderInfoModel::getNumData($started, $ended, $order_status, Admin::user()->id);
// 卡片内容 // 卡片内容
$this->withContent($count); $this->withContent($count);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment