@@ -32,7 +32,9 @@ class Teac extends Api
->where('product_teac.status', ProductTeac::Normal)->where('type_id', $type_id)
->order('create_time desc')
->paginate($this->pageSize);
-
+ foreach ($list as &$item) {
+ $item->users->avatar = !empty($item->users->avatar)? $item->users->avatar:$this->request->domain().'/assets/img/logo.png'; // 头像
+ }
$this->success('ok', $list);
}
@@ -26,7 +26,7 @@ class TeacLogin
*/
public static function setCreateTrade(int $uid, float $price, int $stock, int $typeId, float $frozen):object
{
- $rows = ProductTeac::where('user_id', $uid)->where('status', ProductTeac::Normal)->find();
+ $rows = ProductTeac::where('user_id', $uid)->where('type_id', $typeId)->where('status', ProductTeac::Normal)->find();
if($rows) throw new Exception(__("你有未完成的求购订单、不能重复发布"));
//添加订单信息