Commit 75ad5f14 by 孙龙

弹框操作

parent d6554ecf
......@@ -2,7 +2,7 @@
namespace App\Admin\Controllers;
use App\Admin\Repositories\Order as OrderRepository;
use App\Admin\Actions\OrderAuditAction;
use App\Models\Cms\CmsUser;
use App\Models\Order;
use Dcat\Admin\Form;
......@@ -10,11 +10,7 @@ use Dcat\Admin\Grid;
use Dcat\Admin\Show;
use Dcat\Admin\Http\Controllers\AdminController;
use Dcat\Admin\Layout\Content;
use Dcat\Admin\Layout\Column;
use Dcat\Admin\Layout\Row;
use Dcat\Admin\Admin;
use App\Admin\Renderable\UserTable;
use Dcat\Admin\Models\Administrator;
class OrderController extends AdminController
......@@ -28,6 +24,7 @@ class OrderController extends AdminController
*/
public function index(Content $content)
{
return $content
->translation($this->translation())
->title($this->title())
......@@ -79,6 +76,9 @@ class OrderController extends AdminController
return intval($create_time) > 0 ? date("Y-m-d H:i:s",intval($create_time)) : "-";
});
$grid->showFilter();
$grid->disableActions();
$grid->filter(function (Grid\Filter $filter) {
......@@ -102,6 +102,17 @@ class OrderController extends AdminController
$filter->equal('sales_id',trans('inquiry.fields.sales_name'))->select(CmsUser::pluck('name', 'userId')->where("status",0)->toArray())->width(3);
});
$grid->tools([
new OrderAuditAction(),
]);
});
}
......
......@@ -17,10 +17,19 @@ class Order extends Model
public $timestamps = false;
public static $STATUS_WAIT_AUDIT = 1;//待审核
public static $STATUS_WAIT_PAY = 2;//待付款
public function scmUser()
{
return $this->belongsTo(ScmUser::class, 'user_id', 'id');
}
//审核订单
public static function auditOrder($orderIds=[]){
return self::whereIn("order_id",$orderIds)->where("status",self::$STATUS_WAIT_AUDIT)->update(["status"=>self::$STATUS_WAIT_PAY]);
}
}
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