Commit a177364d by 孙龙

订单详情

parent 8b9685de
<?php
namespace App\Admin\Pages;
use Illuminate\Contracts\Support\Renderable;
class OrderDetailPage implements Renderable
{
public function render()
{
return admin_view('admin.pages.order-page');
}
}
<?php
namespace App\Exceptions;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;
/*
*无效请求异常
*/
class InvalidRequestException extends \Exception
{
public function __construct($message = "", $code = 200)
{
parent::__construct($message, $code);
}
public function render(Request $request)
{
return response()->json(["code"=>1,"msg"=>$this->getMessage(),"data"=>[]]);
}
}
<?php
namespace App\Models;
use App\Exceptions\InvalidRequestException;
use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Arr;
class Increasid extends Model
{
use HasDateTimeFormatter;
protected $table = 'increasid';
protected $primaryKey = 'id';
public $timestamps = false;
static $increas_type=[
"1"=>"PI",
"2"=>"CI",
"3"=>"PL",
];
static $TYPE_ORDER = 1;//订单
static $INCREAS_TYPE_PI = 1;
static $INCREAS_TYPE_CI = 2;
static $INCREAS_TYPE_PL = 3;
public static function getSn($increasType,$type=1){
$isExists = self::where("type",self::$TYPE_ORDER)->where("increas_type",$increasType)
->where("year",date("Y"))
->where("month",date("m"))
->where("day",date("d"))
->orderBy("id","DESC")
->first();
$data=[];
$data["type"] = intval($type);
$data["increas_type"] = intval($increasType);
$data["year"] = (int)date("Y");
$data["month"] = (int)date("m");
$data["day"] = (int)date("d");
$data["num"] = $isExists ? ($isExists->num+1) : 1;
$bk = self::insert($data);
if(!$bk){
return "";
}
return sprintf("%sSEMOUR%s%s%s-%s",Arr::get(self::$increas_type,$increasType,""),$data["month"],$data["day"],$data["year"],str_pad($data["num"],4,"0",STR_PAD_LEFT));
}
}
<?php
namespace App\Models;
use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\Model;
class OrderAddress extends Model
{
use HasDateTimeFormatter;
protected $table = 'order_address';
protected $primaryKey = 'order_address_id';
public $timestamps = false;
public function order()
{
return $this->belongsTo(Order::class, 'order_id', 'order_id');
}
public static function getOrderAddress($orderId=0){
return self::where("order_id",$orderId)->get()->toArray();
}
}
<div class="my-class">你好 帅哥</div>
<style>
.my-class {
color: blue;
}
</style>
<script require="@test1,@test2" init=".my-class">
$this.css({background: 'red'})
</script>
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 sign in to comment