Merge branch 'yukiyukiyu-master'
This commit is contained in:
@@ -11,6 +11,7 @@ use App\User;
|
||||
use App\Announcement;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Ticket;
|
||||
use App\Transaction;
|
||||
use Mews\Purifier\Purifier;
|
||||
|
||||
class AdminController extends Controller
|
||||
@@ -28,7 +29,9 @@ class AdminController extends Controller
|
||||
$data['users'] = User::orderby('id', 'asc')->get();
|
||||
$data['cats'] = GoodCat::orderby('cat_name', 'asc')->get();
|
||||
$data['announcements'] = Announcement::orderby('id', 'dsc')->get();
|
||||
$data['reports'] = Ticket::where('type', '2')->orderby('id', 'dsc')->paginate(16);
|
||||
$data['reports'] = Ticket::where('type', '2')->orderby('id', 'dsc')->paginate(40);
|
||||
$data['users'] = User::orderby('id', 'asc')->paginate(40);
|
||||
$data['trans'] = Transaction::orderby('id', 'asc')->paginate(40);
|
||||
return View::make('admin.index')->with($data);
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ use App\Http\Controllers\Controller;
|
||||
use App\GoodInfo;
|
||||
use App\GoodCat;
|
||||
use App\Announcement;
|
||||
use App\Transaction;
|
||||
|
||||
class ContentController extends Controller
|
||||
{
|
||||
@@ -25,6 +26,7 @@ class ContentController extends Controller
|
||||
$data['catgoods'][$cat->cat_name] = GoodInfo::where('cat_id', $cat->id)->where('baned', false)->where('count', '>', 0)->inRandomOrder()->limit(4)->get();
|
||||
}
|
||||
$data['announces'] = Announcement::orderby('id', 'dsc')->limit(3)->get();
|
||||
$data['trans'] = Transaction::where('status', '>', 3)->orderby('id', 'dsc')->get();
|
||||
return View::make('welcome')->with($data);
|
||||
}
|
||||
|
||||
|
||||
+3
-1
@@ -20,7 +20,8 @@ class Transaction extends Model
|
||||
|
||||
public function getSellerIdAttribute()
|
||||
{
|
||||
return $this->good->user_id;
|
||||
if($this->good != NULL)
|
||||
return $this->good->user_id;
|
||||
}
|
||||
|
||||
public function seller()
|
||||
@@ -32,4 +33,5 @@ class Transaction extends Model
|
||||
{
|
||||
return $this->hasOne('App\Ticket', 'trans_id');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -39,4 +39,14 @@ class User extends Model
|
||||
return $this->belongsTo('App\Wechat', "wechat_open_id", "open_id");
|
||||
}
|
||||
|
||||
public function getcoding()
|
||||
{
|
||||
$len=strlen($this->stuid);
|
||||
$ans = "";
|
||||
$ans = $ans . substr($this->stuid, 0, 1);
|
||||
for($i=1; $i<($len-1); $i++) $ans = $ans . '*';
|
||||
$ans = $ans . substr($this->stuid, -1);
|
||||
return $ans;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user