12345678910111213141516171819202122232425 |
- <?php
- /**
- * Author: luzheng.liu
- * Time: 2021/6/7 17:18
- */
- namespace app\api\model;
- use app\common\until\Until;
- class ProductTemplateModel extends BaseModel {
- protected $table = 'product_template';
- public function getTemplateProductInfo(int $templateId) {
- $rs = $this->alias('pt')
- ->field('p.*,pt.price realPrice,pt.template_id,pt.product_id')
- ->join('product p', 'p.id = pt.product_id')
- ->where([['p.status','=', ProductModel::NORMAL],['pt.template_id','=',$templateId]])
- ->select();
- return Until::modelToArray($rs);
- }
- }
|